<jupyter_start><jupyter_text>Gerando dados para teste de funções de agrupamento<jupyter_code>(x, y) = datasets.make_moons(n_samples=1500, noise=.1)
plt.scatter(x[:,0], x[:, 1], s=5)<jupyter_output><empty_output><jupyter_text>Treinamento de modelos<jupyter_code>cores = np.array(['red', 'blue'])
kmeans = KMeans(n_clusters=2)
previsoes = kmeans.fit_predict(x)
plt.scatter(x[:,0], x[:, 1], s=5, color=cores[previsoes])
hc = AgglomerativeClustering(n_clusters=2, affinity='euclidean', linkage='ward')
previsoes = hc.fit_predict(x)
plt.scatter(x[:,0], x[:, 1], s=5, color=cores[previsoes])
dbscan = DBSCAN(eps=0.1)
previsoes = dbscan.fit_predict(x)
plt.scatter(x[:,0], x[:, 1], s=5, color=cores[previsoes])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19262295081967212, 'fraction_numerical': 0.028688524590163935, 'mean_word_length': 9.940298507462687, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '289690', 'license': 'MIT', 'n_tokens_mistral': 334, 'n_tokens_neox': 315, 'n_words': 48, 'path': 'Comparacao_modelos_categorizacao.ipynb', 'repo_name': 'andrade-lcs/python_machine_learning', 'size': '732'}