Reference: Dorin Comaniciu and Peter Meer, ?Mean Shift: A robust approach toward feature space analysis?. IEEE Transactions on Pattern Analysis and Machine Intelligence. 2002. pp. 603-619. print(__doc__)
import numpy as np
from sklearn.cluster import MeanShift, estimate_bandwidth
from sklearn.datasets.samples_generator import make_blobs
Generate sample data centers = [[1, 1], [-1, -1], [1, -1]]
X, _ = make_blobs(n_samples=10000, centers=centers, cluster_std=0.6)
Compute clustering with Mean