that' all note that in contrast to the previous pca examplewe provide the class labels to the fit_transform(method thuswhereas pca is an unsupervised feature extraction methodlda is supervised one the result looks as expectedthen why to consider pca in the first place and not use lda onlywellit is not that simple with the increasing number of classes and less samples per classlda does not look that well any more alsopca seems to be not as sensitive to different training sets as lda so when we have to advise which method to usewe can only suggest clear "it dependsmultidimensional scaling (mdson one handpca tries to use optimization for retained varianceand on the other handmds tries to retain the relative distances as much as possible when reducing the dimensions this is useful when we have high-dimensional dataset and want to get visual impression mds does not care about the data points themselvesinsteadit is interested in the dissimilarities between pairs of data points and interprets these as distances the first thing the mds algorithm is doing isthereforetaking all the data points of dimension and calculates distance matrix using distance function which measures the (most of the timeeuclideandistance in the original feature space