Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Regroupement par Déplacement de la Moyenne | Algorithmes de Regroupement de Base
Analyse de Cluster

bookRegroupement par Déplacement de la Moyenne

123456789101112131415
from sklearn.cluster import MeanShift import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs, make_moons # Create dataset for clustering X, y = make_blobs(n_samples=500, cluster_std=1, centers=4 ) transformation = [[0.6, -0.6], [-0.4, 0.8]] X_aniso = np.matmul(X, transformation) # Train Mean Shift model on blobs dataset and visualize the results blobs_clustering = MeanShift(bandwidth=2).fit(X_aniso) fig, axes = plt.subplots(1, 2) axes[0].scatter(X[:, 0], X[:, 1], c=blobs_clustering.labels_, s=50, cmap='tab20b') axes[0].set_title('Clustered anizo blobs data') axes[1].scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='tab20b') axes[1].set_title('Real anizo blobs data')
copy
12345678910111213
from sklearn.datasets import make_moons import matplotlib.pyplot as plt from sklearn.cluster import MeanShift # Create moons dataset for clustering X, y = make_moons(n_samples=500) # Fit Mean Shift model on moons dataset and visualize the results moons_clustering = MeanShift(bandwidth=0.7).fit(X) fig,axes = plt.subplots(1,2) axes[0].scatter(X[:, 0], X[:, 1], c=moons_clustering.labels_, s=50, cmap='tab20b') axes[0].set_title('Clustered moons data') axes[1].scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='tab20b') axes[1].set_title('Real moons data')
copy
question mark

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 5

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

bookRegroupement par Déplacement de la Moyenne

123456789101112131415
from sklearn.cluster import MeanShift import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs, make_moons # Create dataset for clustering X, y = make_blobs(n_samples=500, cluster_std=1, centers=4 ) transformation = [[0.6, -0.6], [-0.4, 0.8]] X_aniso = np.matmul(X, transformation) # Train Mean Shift model on blobs dataset and visualize the results blobs_clustering = MeanShift(bandwidth=2).fit(X_aniso) fig, axes = plt.subplots(1, 2) axes[0].scatter(X[:, 0], X[:, 1], c=blobs_clustering.labels_, s=50, cmap='tab20b') axes[0].set_title('Clustered anizo blobs data') axes[1].scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='tab20b') axes[1].set_title('Real anizo blobs data')
copy
12345678910111213
from sklearn.datasets import make_moons import matplotlib.pyplot as plt from sklearn.cluster import MeanShift # Create moons dataset for clustering X, y = make_moons(n_samples=500) # Fit Mean Shift model on moons dataset and visualize the results moons_clustering = MeanShift(bandwidth=0.7).fit(X) fig,axes = plt.subplots(1,2) axes[0].scatter(X[:, 0], X[:, 1], c=moons_clustering.labels_, s=50, cmap='tab20b') axes[0].set_title('Clustered moons data') axes[1].scatter(X[:, 0], X[:, 1], c=y, s=50, cmap='tab20b') axes[1].set_title('Real moons data')
copy
question mark

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 5
some-alt