Question
Load Iris dataset. It includes 3 classes (Setosa, Versicolor, and Virginica flowers). There are 4 features per sample (Sepal-length Sepal-width Petal-length Petal-width), and there are
Load Iris dataset. It includes 3 classes (Setosa, Versicolor, and Virginica flowers). There are 4 features per sample (Sepal-length Sepal-width Petal-length Petal-width), and there are 50 samples for each class totaling 150 samples. print features of the first 10 samples. Import numpy library and use mean and std methods to transform the data to center it by removing the mean value of each feature, then scale it by dividing non-constant features by their standard deviation. Perform 2-D plot all combinations of features (12 figures) using matplot library and scatter method (like figure below). Use PCA method in the sklearn library to find the first 2 principal components. Then, plot them for the 3 classes. Use LinearDiscriminantAnalysis method in the sklearn library to maximize the separation between the 3 classes. Compare LDA with PCA.
- Can you please use Python programming language for solving this question, thank you.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started