[scikit-learn] Drawing contours in KMeans
ahowe42 at gmail.com
Wed Dec 9 05:47:40 EST 2020
Contours generally indicate a third variable - often a probability density.
Kmeans doesn't provide density estimates, so what precisely would you want
the contours to represent?
J. Andrew Howe, PhD
LinkedIn Profile <http://www.linkedin.com/in/ahowe42>
ResearchGate Profile <http://www.researchgate.net/profile/John_Howe12/>
Open Researcher and Contributor ID (ORCID)
Github Profile <http://github.com/ahowe42>
Personal Website <http://www.andrewhowe.com>
I live to learn, so I can learn to live. - me
On Wed, Dec 9, 2020 at 9:41 AM Mahmood Naderan <mahmood.nt at gmail.com> wrote:
> I use the following code to highlight the cluster centers with some red
> kmeans = KMeans(n_clusters=6, init='k-means++', max_iter=100, n_init=10,
> pred_y = kmeans.fit_predict(a)
> plt.scatter(a[:,0], a[:,1])
> plt.scatter(kmeans.cluster_centers_[:, 0], kmeans.cluster_centers_[:, 1],
> s=100, c='red')
> I would like to know if it is possible to draw contours over the clusters.
> Is there any way for that?
> Please let me know if there is a function or option in KMeans.
> scikit-learn mailing list
> scikit-learn at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the scikit-learn