Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created March 15, 2021 07:04
Embed
What would you like to do?
from sklearn.cluster import Birch
model = Birch(branching_factor=30, n_clusters=5, threshold=2.5)
model.fit(data)
pred = model.predict(data)
plt.scatter(data["Income"], data["Spending"], c=pred, cmap='rainbow', alpha=0.5, edgecolors='b')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment