Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 858 Bytes

elbow.rst

File metadata and controls

30 lines (19 loc) · 858 Bytes

Elbow Method

The elbow method for K selection visualizes multiple clustering models with different values for K. Model selection is based on whether or not there is an "elbow" in the curve; e.g. if the curve looks like an arm, if there is a clear change in angle from one part of the curve to another.

# Make 8 blobs dataset
X, y = make_blobs(centers=8)
# Instantiate the clustering model and visualizer
visualizer = KElbowVisualizer(MiniBatchKMeans(), k=(4,12))

visualizer.fit(X) # Fit the training data to the visualizer
visualizer.poof() # Draw/show/poof the data

image

API Reference

yellowbrick.cluster.elbow