السلام عليكم
ده البيانات المستخدما
وده الكود
from pandas import read_csv
from sklearn.cluster import KMeans
data = read_csv("Customer.csv")
kmeans_model = KMeans(n_clusters=5 , init='k-means++' , random_state=33 , algorithm='auto')
fit = kmeans_model.fit(data)
print(f"KMeans centers are: {fit.cluster_centers_}")
print(f"Kmeans labels are: {fit.labels_}")
print(f"Kmeans intertia is: {fit.inertia_}")
Customer.csv