-
Notifications
You must be signed in to change notification settings - Fork 14
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
Refactor to a class #12
Comments
why TypeScript? I think that the class is not a bad idea, do you see any advantage doing this? |
I think that's a very good idea. People will be familiar with the API. I think most people doing ML have worked with python and scikit before. @maasencioh we've been experimenting with Typescript and it's awesome.
|
Syntax is like Java, for reading the code maybe it's better, you need to write more code for the same result but personally I like the comments functionality for the argument types |
Migrating to a class would be great indeed but I would prefer to have something similar to pca, pls and other packages const kMeans = new KMeans(dataset, options); (or new KMeans(dataset, numberClusters, options))
const newPoints = [[4.9, 3.2, 1.2, 0.4], [5.4, 3.3, 1.4, 0.9]];
console.log(kMeans.predict(newPoints)); // project new points into the PCA space
const model2 = kMeans.toJSON(); // to save the model
const kMeans2 = KMeans.load(model);
kMeans2.predict(newPoints); |
I'd like to refactor the library to a class, with an API similar to sklearn: http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html
I'll migrate to TypeScript at the same time.
@mljs/collaborators WDYT?
The text was updated successfully, but these errors were encountered: