Face Clustering Task: Apply PCA and K-Means on Face Dataset. The classic Olivetti faces dataset contains 400 grayscale 6
Posted: Sat May 14, 2022 3:31 pm
Face Clustering Task: Apply PCA and K-Means on Face Dataset. The classic Olivetti faces dataset contains 400 grayscale 64 x 64 pixel images of faces. In this lab task, we will cluster these face images using K-Means and visualize the result to observe similarities in each cluster. Olivetti dataset: https://scikit-learn.org/stable/modules ... faces.html 0 0 2 2 2 2 2 2 2 2 Step 1: Load Olivetti face dataset. [1') Load the dataset using the sklearn.datasets.fetch_olivetti_faces() function. Explain why each row of data’ is a ID vector of size 4096, and how many different labels this dataset has. Step 2: Train Test Split. Split the dataset into training and test sets with train_test_split(). Set parameter test_size=0.3, random_state to the last two digits of your student ID. Please attach your name and student id in a separate markdown cell as proof.
Step3: Reduce Dimensionality with PCA. [2] To speed things up, reduce the training data's dimensionality using PCA. Please set the ratio of variance you wish to preserve as 99%. Then, please answer the below questions: 1) What's the dimensionality of the original training data? 2) What's the dimensionality of the compressed training data? Step 4: Cluster the compressed training images using K-Means. [2] Please set the number of clusters as 120 and the random_state as the last two digits of your student id. Step 5: Visualize the clusters. [1'] Visualize the clusters. You can use the provided function ‘plot_faces' (see Lab5_hints.ipynb). What do you think of the clustering result? Do you see similar faces in each cluster?
Please set the number of clusters as 120 and the random_state as the last two digits of your student id. Step 5: Visualize the clusters. [1'] Visualize the clusters. You can use the provided function “plot_faces' (see Lab5_hints.ipynb). What do you think of the clustering result? Do you see similar faces in each cluster? P.s. Expected clustering outputs may like: Cluster 0 32 32 32 32 Cluster 1 13 13 13 13 Cluster 2 14 14 14
Step3: Reduce Dimensionality with PCA. [2] To speed things up, reduce the training data's dimensionality using PCA. Please set the ratio of variance you wish to preserve as 99%. Then, please answer the below questions: 1) What's the dimensionality of the original training data? 2) What's the dimensionality of the compressed training data? Step 4: Cluster the compressed training images using K-Means. [2] Please set the number of clusters as 120 and the random_state as the last two digits of your student id. Step 5: Visualize the clusters. [1'] Visualize the clusters. You can use the provided function ‘plot_faces' (see Lab5_hints.ipynb). What do you think of the clustering result? Do you see similar faces in each cluster?
Please set the number of clusters as 120 and the random_state as the last two digits of your student id. Step 5: Visualize the clusters. [1'] Visualize the clusters. You can use the provided function “plot_faces' (see Lab5_hints.ipynb). What do you think of the clustering result? Do you see similar faces in each cluster? P.s. Expected clustering outputs may like: Cluster 0 32 32 32 32 Cluster 1 13 13 13 13 Cluster 2 14 14 14