# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.datasets.samples_generator import make_blobs
import warnings
warnings.filterwarnings("ignore")


# +
x, y = make_blobs(n_samples = 200, centers = 5)
plt.scatter(x[:,0], x[:,1])



# +
kmeans = KMeans(n_clusters = 5)
kmeans.fit(x)


# -

previsoes = kmeans.predict(x)
plt.scatter(x[:,0], x[:,1], c = previsoes)



StarcoderdataJupyterScriptsDedupFiltered