<｜begin▁of▁sentence｜>### Instruction:
Given a dataset of 100 samples with 3 features each, represented as a numpy array X of shape (100, 3), generated from a random normal distribution, how would you use the graspologic GaussianCluster class to determine the optimal number of Gaussian mixture components based on the Bayesian Information Criterion (BIC), considering all possible covariances types, and range of components from 2 to 5?
### Response:
from graspologic.cluster import GaussianCluster
import numpy as np

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

# Initialize GaussianCluster with specified parameters
clusterer = GaussianCluster(min_components=2, max_components=5, covariance_type='all')

# Fit the model
clusterer.fit(X)

# Predict the labels
labels = clusterer.predict(X)

# Print the optimal number of components based on BIC
print('Optimal number of components:', clusterer.n_components_)
<|EOT|>
