In this video, I tried to perform spectral clustering using sklearn's iris dataset. In spectral clustering, the data points are treated as nodes of a graph. So, the clustering is treated as a graph partitioning problem. The nodes are then mapped to a low-dimensional space that can be easily segregated to form clusters. Spectral clustering is a popular unsupervised learning algorithm. Nevertheless, I calculated some external validation indices at the end of this tutorial as the iris dataset comes with externally provided labels (ground truths) to determine the similarity with the known solution.
GitHub address: https://github.com/randomaccess2023/M...
For details on skelarn's iris dataset, check this link: https://scikit-learn.org/stable/auto_...
For more details on spectral clustering, check this out: https://scikit-learn.org/stable/modul...
Description:
01:00 Import the required libraries
02:26 Load 'iris' dataset
03:27 Create a dataframe
04:57 Separate the features from the dataframe
05:35 Perform preprocessing
06:27 Scaled dataframe
07:36 Perform 'spectral clustering' with 3 clusters
09:38 Add two new columns to the scaled dataframe
11:49 Clustering comparison between ground truths and predictions
15:37 Calculate a few external validation metrics
#datascience #spectralclustering #sklearn #irisdataset #jupyternotebook #python