Category : k-means

I am current working on how to deal with a multi-dimensional dataset in clustering. The dataset has more than 120 items with 6 features but without y label. For example: """ ###################################################################################### # Id EndDate EPS PE PB NetProfit ROE ROA# # 1 2020/12/31 1.2 3.4 1.1 30 40 13 # # 2 2020/12/31 0.4 ..

Read more

I am new to kmeans. My graph has clusters but has the same color. I need each cluster to have different colors. I tried many ways to do it, followed instructions, and worked hours, but I failed to do it. I also tried with sklearn.cluster. Here is the main code. import matplotlib.pyplot as plt def ..

Read more

I’m trying to get reproducible results from sklearn’s KMeans running on a Google Colab notebook. Every time I restart the notebook’s runtime, fit, predict and generate the silhouette_score of a K-means algorithm, the silhouette_score changes! The following is the code I run to generate the silhouette_score: for n_clusters in range(3,9): kmeans = KMeans(init=init, n_clusters = ..

Read more