Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from sklearn.cluster import AgglomerativeClustering
model = AgglomerativeClustering()
model.fit(data)
pred = model.fit_predict(data)
plt.style.use('seaborn-whitegrid')
plt.figure(figsize=(12, 10))
plt.scatter(data["Income"], data["Spending"], c=pred, cmap='rainbow', alpha=0.9)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment