You can now apply the KMeans algorithm to see how it works:
from sklearn.cluster import KMeansestimators = [{'estimator': KMeans, 'args':(), 'kwargs':{'n_clusters': 4}}]unsupervised_learner = Unsupervised_AutoML(estimators)
You can see the estimators:
unsupervised_learner.estimators
These will output the following:
[{'args': (), 'estimator': sklearn.cluster.k_means_.KMeans, 'kwargs': {'n_clusters': 4}}]
You can now invoke fit_predict to obtain predictions and performance_metrics:
predictions, performance_metrics = unsupervised_learner.fit_predict(X, y)
Metrics will be written to the console:
################## KMeans metrics ##################### Silhouette Coefficient: 0.631 Estimated number of clusters: 4.000 ...