Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions