<jupyter_start><jupyter_text>implement for k = 3<jupyter_code>kmeans_3 =KMeans(n_clusters=3, init = 'k-means++', max_iter = 300, n_init = 10,random_state=0)
ymeans = kmeans_3.fit_predict(x)
print(ymeans)
print(kmeans_3.cluster_centers_)
plt.scatter(x[ymeans==0,0],x[ymeans==0, 1],
           s=100,c='red', label='setosa')
plt.scatter(x[ymeans==1,0],x[ymeans==1, 1],
           s=100,c='green', label='versicolor')
plt.scatter(x[ymeans==2,0],x[ymeans==2, 1],
           s=100,c='blue', label='virginica')
plt.scatter(kmeans_3.cluster_centers_[:,0], kmeans_3.cluster_centers_[:,1],
           s=100,c='yellow', label='centroids')
plt.legend()
sample_test = np.array([5.1,3.5,1.4,0.3])
sample_test= sample_test.reshape(1,-1)

kmeans_3.predict(sample_test)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20178799489144317, 'fraction_numerical': 0.06385696040868455, 'mean_word_length': 6.39622641509434, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '124773', 'license': 'Apache-2.0', 'n_tokens_mistral': 374, 'n_tokens_neox': 343, 'n_words': 37, 'path': 'Machine Learning/K-Means Clustring/K_Means Clustring.ipynb', 'repo_name': 'ankiii07/Data-Science-Intern', 'size': '783'}