Question: 1. PCA Problem 1: Complete the following experiment. (20 Points) Perform dimensionality reduction using PCA with n_components=2 for the iris dataset from sklearn (import datasets
1. PCA
Problem 1: Complete the following experiment. (20 Points)
Perform dimensionality reduction using PCA with n_components=2 for the iris dataset from sklearn (import datasets and call load_iris()).
Print the variance and explained variance ratio for those two components using pca.explained_variance and pca.explained_variance_ratio
Plot the dataset with reduced dimentions using a scatter plot.
Note: load_iris() returns a data structure with the data attribute being the features and the target attribute being the labels.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
