Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double dispatch for #fit: method #2

Open
hernanmd opened this issue Nov 12, 2020 · 1 comment
Open

Double dispatch for #fit: method #2

hernanmd opened this issue Nov 12, 2020 · 1 comment

Comments

@hernanmd
Copy link
Member

Currently I'm using k-means with DataFrame as follows:

| df kmeans |
df := Datasets loadIris columnsFrom: 1 to: 4.
kmeans := KMeans numberOfClusters: 3.
kmeans fit: (df asArrayOfRows collect: #asArray).

It would be nice if the argument to #fit: could be just the DataFrame, which knows how to be fitted with a KMeans algorithm:

kmeans fit: df

This way fit could receive also PMMatrix and similar matrix-like objects. And each one is responsible to implement:

DataFrame>>fitKMeans: aKmeans
  aKmeans fit: (self asArrayOfRows collect: #asArray).

and so on...

@jordanmontt
Copy link
Member

Yes, this is an issue for all the ml algos that we have. We should make them compatible with DataFrame

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants