text_plain_output_1.png image_output_1.png
from sklearn.cluster import KMeans

import matplotlib.pyplot as plt

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)

plt.scatter(clusters['tatmin'], clusters['sadakat'], c=clusters['kume_tahmin'], cmap='rainbow')
plt.xlabel('Tatmin')
plt.ylabel('Sadakat')