<｜begin▁of▁sentence｜>### Instruction:
A data scientist has a dataset of 2-dimensional data points and wants to use Gaussian Mixture Modeling to determine the optimal number of clusters for this dataset. The data scientist would like to evaluate the clustering configurations using the Bayesian Information Criterion (BIC) over a range of possible cluster numbers. How can the `GaussianCluster` class from graspologic be used to find the optimal number of clusters and associated covariance type, and to generate the cluster labels for each data point?
### Response:
import numpy as np
from graspologic.cluster import GaussianCluster

# Generate synthetic data with 2 features
np.random.seed(42)
X = np.random.randn(100, 2)

# Initialize GaussianCluster object to find the best number of clusters with BIC
gmm_cluster = GaussianCluster(min_components=2, max_components=5, covariance_type='all')

# Fit the model
gmm_cluster.fit(X)

# Predict the cluster labels
labels = gmm_cluster.fit_predict(X)

# Retrieve the optimal number of components and covariance type
n_components = gmm_cluster.n_components_
covariance_type = gmm_cluster.covariance_type_

print(f'Optimal number of clusters: {n_components}')
print(f'Optimal covariance type: {covariance_type}')
print(f'Cluster labels: {labels}')
<|EOT|>
