58
loading...
This website collects cookies to deliver better user experience
scikit-learn
library provides a subpackage, called sklearn.cluster
, which provides the most common clustering algorithms.sklearn.cluster
subpackage defines two ways to apply a clustering algorithm: classes and functions.from sklearn.cluster import AffinityPropagation
model = AffinityPropagation()
model.fit(X)
labels = model.predict(X)
from sklearn.cluster import affinity_propagation
result = affinity_propagatiom(X)
scikit-learn
, often this parameter is called n_clusters.sklearn.cluster
package provides the following clustering algorithms belonging to this category (both the (both the class and the function is shown for each provided algorithm):