This code is for excuting PCA and then reducing a dimension of dataset.The prnciple of PCA is like below.
This project contains three-python files. The description of each file is as follows.
If you run this code, you can get a figure like below one. It means that we cannot split data in the two dimension space as a result of PCA. In this case, you have two-options to enhance the classification performance. First one is increase the dimension of PCA, Sencond one is using LDA(Linear Discriminant Analysis). In this project, I'll use the first one. Then, we have to check how many dimension to be used for classifying the data perfectly.
In the paragraph above, I said that we should look into how many dimensions to use. This file deals with it. Below figure represents that if we use the PCA going to 3-dimension, we can split the data with high performance.
This file represents that how data is splited in the 3-dimension space.
Below figure is the result of this file.