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

Missing labels_ and predict function for K-Means #515

Closed
liufsd opened this issue May 27, 2019 · 9 comments
Closed

Missing labels_ and predict function for K-Means #515

liufsd opened this issue May 27, 2019 · 9 comments
Assignees
Labels
Enhancement Tasks related to enhancement and development Proposal Tasks that have been proposed by users

Comments

@liufsd
Copy link

liufsd commented May 27, 2019

Great work. but k-means missing labels_ and predict function like sklearn ~ https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html#sklearn.cluster.KMeans

@liufsd
Copy link
Author

liufsd commented May 27, 2019

     Examples
    --------
    >>> from sklearn.cluster import KMeans
    >>> import numpy as np
    >>> X = np.array([[1, 2], [1, 4], [1, 0],
    ...               [10, 2], [10, 4], [10, 0]])
    >>> kmeans = KMeans(n_clusters=2, random_state=0).fit(X)
    >>> kmeans.labels_
    array([1, 1, 1, 0, 0, 0], dtype=int32)
    >>> kmeans.predict([[0, 0], [12, 3]])
    array([1, 0], dtype=int32)
    >>> kmeans.cluster_centers_
    array([[10.,  2.],
           [ 1.,  2.]])

https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/cluster/k_means_.py

@annoviko
Copy link
Owner

Hello, @liufsd,
Thank you for your comments. About labels: pyclustering provides labels in different way, see get_clusters() method - https://pyclustering.github.io/docs/0.9.0/html/da/d22/classpyclustering_1_1cluster_1_1kmeans_1_1kmeans.html .

About prediction - I agree, it is useful feature, I will introduce this method.

@annoviko annoviko added Proposal Tasks that have been proposed by users Enhancement Tasks related to enhancement and development labels May 27, 2019
@liufsd
Copy link
Author

liufsd commented May 27, 2019

thanks~

@liufsd
Copy link
Author

liufsd commented Jun 1, 2019

Hello , any progress ?

@annoviko
Copy link
Owner

annoviko commented Jun 1, 2019

Hello, @liufsd ,
Don't worry, it will be delivered in 0.9.1.

@liufsd
Copy link
Author

liufsd commented Jun 3, 2019

ok~

@vivekverma080698
Copy link

Hi @annoviko how can I contribute to this predict feature ?.
I need this feature in great hurry for OPTICS. Thank you

@annoviko
Copy link
Owner

Hello, @vivekverma080698 , at least article is required that described how to do that for OPTICS. And implementation itself is also can be contributed. In this thread we were talking about prediction for K-Means.

@annoviko annoviko changed the title Missing labels_ and predict function like sklearn Missing labels_ and predict function for K-Means Jun 20, 2019
@liufsd
Copy link
Author

liufsd commented Jun 29, 2019

@annoviko Hello , any progress ?? ?
😢

@liufsd liufsd closed this as completed Jul 3, 2019
@annoviko annoviko self-assigned this Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Tasks related to enhancement and development Proposal Tasks that have been proposed by users
Projects
None yet
Development

No branches or pull requests

3 participants