April 2018
Beginner to intermediate
282 pages
6h 52m
English
Our last try will be with an agglomerative clustering algorithm:
from sklearn.cluster import AgglomerativeClusteringestimators = [{'estimator': AgglomerativeClustering, 'args':(), 'kwargs':{'n_clusters': 4, 'linkage': 'ward'}}]unsupervised_learner = Unsupervised_AutoML(estimators)predictions, performance_metrics = unsupervised_learner.fit_predict(X, y)
Metrics in the console are as follows:
################## AgglomerativeClustering metrics ##################### Silhouette Coefficient: 0.546 Estimated number of clusters: 4.000 Homogeneity: 0.751 Completeness: 0.905 V-measure: 0.820 Adjusted Rand Index: 0.719 Adjusted Mutual Information: 0.750
AgglomerativeClustering clusters are plotted as follows: ...