-
-
Save amankharwal/8bff217ffecf20ba6177624f2ff013d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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