train a model with n clusters, using df ‘x’
kmeans = KMeans(n)
kmeans.fit(x)
see which cluster each data point in ‘x’ is assigned
identified_clusters = kmeans.fit_predict(x) df['Cluster'] = identified_clusters
what is the measure to use to determine number of k? what is it called? What’s the code?
kmeans.inertia_