<jupyter_start><jupyter_text>k-means Example* Source : https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html  Model Training<jupyter_code>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_<jupyter_output><empty_output><jupyter_text>Evaluation<jupyter_code>kmeans.predict([[0, 0], [12, 3]])<jupyter_output><empty_output><jupyter_text>Model<jupyter_code>kmeans.cluster_centers_<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16291161178509533, 'fraction_numerical': 0.038128249566724434, 'mean_word_length': 7.757575757575758, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '268763', 'license': 'Apache-2.0', 'n_tokens_mistral': 253, 'n_tokens_neox': 236, 'n_words': 33, 'path': '3.MachineLearning/k-means.ipynb', 'repo_name': 'dnworry/AICentroPreLab', 'size': '577'}