Python Bytes - Machine Learning Birch Part 8 Plot Prediction Matplotlib Code in Description

preview_player
Показать описание
#Coded by Andrew C
import pandas as pd
from sklearn import datasets

import numpy

X = wine[['alcohol', 'total_phenols']]

scale = StandardScaler()

BRC = Birch(branching_factor=50, n_clusters=None, threshold=.5)

BRC.fit(X_scaled)

y_pred = BRC.predict(X_scaled)

n = ['0','1','2','3','4',5,6,7,8,9,10,11,12,13,14]

X_scaled[:,1],
c= y_pred)

X_new_scaled[:,1], marker="*",
c= 'red', s=200)

BRC.subcluster_centers_[:, 1],
marker="o",
s = 250,
c = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],
edgecolors='k')

for i, txt in enumerate(n):

#coding #datascience #python
Рекомендации по теме