Sunday, April 10, 2022

Scikit-Learn | PCA

 

Implementing PCA in Python with Scikit-Learn on Iris dataset.



Step 01: importing required libraries

Step 02: importing or loading the datasets

Step 03: distributing the dataset into two components X and Y

Step 04: Splitting the X and Y into the Training set and Testing set

Step 05: performing preprocessing part

Step 06: Applying PCA function on training and testing set of X component

Step 07: Fitting Logistic Regression To the training set

Step 08: Predicting the test set result using predict function under LogisticRegression

Step 09: making confusion matrix between test set of Y and predicted value.

Step 10: Predicting the training set result through scatter plot

Step 11: show scatter plot

Step 12: Visualising the Test set results through scatter plot

Step 13: title for scatter plot

Step 14: show scatter plot






No comments:

Post a Comment

Friendship

Friendship is the most beautiful relation in the world. Friendship is peace, friendship does not have any restrictions of time and space. Th...