<｜begin▁of▁sentence｜>### Instruction:
You have a dataset with 300 samples generated from three Gaussian blobs. You need to determine the optimal number of clusters that the data can be grouped into using K-Means clustering. The `KMeansCluster` class from the `graspologic` library is to be used for this purpose, where the clustering is evaluated using silhouette scores when ground truth labels are not known, and adjusted Rand index (ARI) if labels are provided. After clustering, you are interested in reporting the optimal number of clusters and the cluster labels for each data point. How would you apply the `KMeansCluster` to your dataset?
### Response:
import numpy as np
from graspologic.cluster import KMeansCluster
from sklearn.datasets import make_blobs

# Generate synthetic data with 3 blobs
X, y = make_blobs(n_samples=300, centers=3, cluster_std=0.60, random_state=0)

# Instantiate the clusterer
clusterer = KMeansCluster(max_clusters=5, random_state=42)

# Fit the clusterer to the data
clusterer.fit(X, y)

# Get the optimal number of clusters as per silhouette score or ARI
optimal_clusters = clusterer.n_clusters_

# Get the labels of the clusters
labels = clusterer.predict(X)

# Print the optimal number of clusters and labels for each point
print('Optimal number of clusters:', optimal_clusters)
print('Labels for each point:', labels)

# To use the silhouette list and ARI list
silhouette_list = clusterer.silhouette_list_
ari_list = clusterer.ari_list_ if y is not None else None
print('Silhouette scores list:', silhouette_list)
if ari_list is not None:
    print('ARI scores list:', ari_list)
<|EOT|>
