# 7. Clustering

<figure><img src="https://2909106259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl07NBXgl5MbkBetObqPW%2Fuploads%2FH8OckWQ1yQH6ZfzL534t%2Fimage.png?alt=media&#x26;token=b168d538-471e-4dfc-8361-953f56158dc1" alt="" width="346"><figcaption></figcaption></figure>

1. Click on ***Clustering*** under the ***Machine Learning*** category.

<figure><img src="https://2909106259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl07NBXgl5MbkBetObqPW%2Fuploads%2FGlktFp7EdBRolLJLOXAl%2Fimage.png?alt=media&#x26;token=577ed928-42e4-490c-9842-1c4682c2ef34" alt="" width="563"><figcaption></figcaption></figure>

2. ***Model type***: Select the type of Model you want to use.
   * [KMeans / AgglomerativeClustering](#kmeans-agglomerativeclustering)
   * [GaussianMixture](#gaussianmixture)
   * [DBSCAN](#dbscan)
3. ***Allocate to***: Specify the variable name to assign to the generated model.
4. ***Code view***: Preview the generated code.
5. ***Run***: Execute the code.

***

### KMeans / AgglomerativeClustering

<figure><img src="https://2909106259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl07NBXgl5MbkBetObqPW%2Fuploads%2F95g1XbVPFT8vcfJtpeVC%2Fimage.png?alt=media&#x26;token=626e9c26-8997-4570-b353-421f24f3540d" alt="" width="563"><figcaption></figcaption></figure>

1. ***N clusters***: Specify the number of clusters to be generated.
2. ***Random state***: Set the seed value for the random number generator.

***

### GaussianMixture

<figure><img src="https://2909106259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl07NBXgl5MbkBetObqPW%2Fuploads%2FlXHhEXbpN01rZUfzLLZO%2Fimage.png?alt=media&#x26;token=acdc6d32-31ce-44e2-9531-c41190a21524" alt="" width="563"><figcaption></figcaption></figure>

1. ***N components***: Specify the number of Gaussian distributions to be used by the model to describe the data, determining how many clusters the data will be divided into.
2. ***Random state***: Set the seed value for the random number generator.

***

### DBSCAN

<figure><img src="https://2909106259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl07NBXgl5MbkBetObqPW%2Fuploads%2FDIv5X6JT70cHLJDN5QfD%2Fimage.png?alt=media&#x26;token=a9847153-81b7-4356-ac30-9fd99efed514" alt="" width="563"><figcaption></figcaption></figure>

1. ***Eps (Epsilon)***: Specify the maximum distance (radius) for forming clusters.
2. ***Min samples***: Specify the minimum number of neighboring data points required for a point to be recognized as a cluster.
