<jupyter_start><jupyter_text>Treinando o modelo ML KMeans<jupyter_code>from sklearn.cluster import KMeans
kmeans = KMeans(n_clusters=4)
kmeans.fit(data[0])
kmeans.cluster_centers_
kmeans.labels_
f, (ax1, ax2) = plt.subplots(1, 2, sharey=True, figsize=(10, 6))

ax1.set_title('KMeans')
ax1.scatter(data[0][:, 0], data[0][:, 1], c=kmeans.labels_, cmap='rainbow')

ax2.set_title('Original')
ax2.scatter(data[0][:, 0], data[0][:, 1], c=data[1], cmap='rainbow')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19547325102880658, 'fraction_numerical': 0.04526748971193416, 'mean_word_length': 8.938775510204081, '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': '436524', 'license': 'Apache-2.0', 'n_tokens_mistral': 238, 'n_tokens_neox': 222, 'n_words': 35, 'path': 'secao21 - K_Mens Clustering/aula101_k_means_clustering.ipynb', 'repo_name': 'IgoPereiraBarros/data-science-and-machine-learning', 'size': '486'}