face images we hope to find groups of similar faces--saymen and womenor old people and young peopleor people with beards and without let' say we cluster the data into two clustersand all algorithms agree about which points should be clustered together we still don' know if the clusters that are found correspond in any way to the concepts we are interested in it could be that they found side views versus front viewsor pictures taken at night versus pictures taken during the dayor pictures taken with iphones versus pictures taken with android phones the only way to know whether the clustering corresponds to anything we are interested in is to analyze the clusters manually comparing algorithms on the faces dataset let' apply the -meansdbscanand agglomerative clustering algorithms to the labeled faces in the wild datasetand see if any of them find interesting structure we will use the eigenface representation of the dataas produced by pca(whiten=true)with componentsin[ ]extract eigenfaces from lfw data and transform data from sklearn decomposition import pca pca pca(n_components= whiten=truerandom_state= pca fit_transform(x_peoplex_pca pca transform(x_peoplewe saw earlier that this is more semantic representation of the face images than the raw pixels it will also make computation faster good exercise would be for you to run the following experiments on the original datawithout pcaand see if you find similar clusters analyzing the faces dataset with dbscan we will start by applying dbscanwhich we just discussedin[ ]apply dbscan with default parameters dbscan dbscan(labels dbscan fit_predict(x_pcaprint("unique labels{}format(np unique(labels))out[ ]unique labels[- we see that all the returned labels are - so all of the data was labeled as "noiseby dbscan there are two things we can change to help thiswe can make eps higherto expand the neighborhood of each pointand set min_samples lowerto consider smaller groups of points as clusters let' try changing min_samples firstclustering