text_plain_output_1.png image_output_1.png
from sklearn import preprocessing

from sklearn.cluster import KMeans

import pandas as pd

data = pd.read_csv('../input/market-sadakatcsv/Market_Sadakat.csv')

x = data.copy()

kmeans = KMeans(2)
kmeans.fit(x)

clusters = x.copy()
clusters['kume_tahmin'] = kmeans.fit_predict(x)

from sklearn import preprocessing
x_scaled = preprocessing.scale(x)
x_scaled

kmeans_new = KMeans(4)
kmeans_new.fit(x_scaled)
clusters_new = x.copy()
clusters_new['kume_tahmin'] = kmeans_new.fit_predict(x_scaled)

clusters_new