Write a code snippet to demonstrate the usage of a specific library.

Library Name: Scikit-learn
user
import numpy as np
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans

# Generate a dataset
X, y = make_blobs(n_samples=100, n_features=2, centers=4, random_state=42)

# Instantiate the model
kmeans = KMeans(n_clusters=4, random_state=42)

# Fit the model
kmeans.fit(X)

# Predict labels
y_pred = kmeans.predict(X)
assistant