text_html_output_1.png
from sklearn.cluster import KMeans

import matplotlib.pyplot as plt

import pandas as pd

df = pd.read_csv('../input/whisky.csv')

dist = []
for i in range(2, 20):
    km = KMeans(n_clusters=i, n_init=10, max_iter=500, random_state=0)
    km.fit(df.iloc[:, 2:-3])
    dist.append(km.inertia_)

km = KMeans(n_clusters=5, n_init=10, max_iter=300, random_state=0)
df['class'] = km.fit_predict(df.iloc[:, 2:-3])
df['class'].values