Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#MachineLearning #PythonProgramming Please help. WILL UPVOTE! Please provide the Python Code for the question above! Use the dataset Wisconsin Breast Cancer from Scikit Learn and

#MachineLearning #PythonProgramming

Please help. WILL UPVOTE!

image text in transcribed

Please provide the Python Code for the question above! Use the dataset Wisconsin Breast Cancer from Scikit Learn and provide COMPLETE CODE (with scatterplot) for PART (a) ONLY

ONLY PARTO 2. In this problem we visualize the Wisconsin breast cancer dataset in two dimensions using PCA. First, rescale the data so that every feature has mean 0 and standard deviation 1 across the various points in the dataset. You may find sklearn.preprocessing. StandardScaler useful for this. Next, compute the top two principal components of the dataset using PCA, and for every data point, compute its coordinates (i.e. projections) along these two principal components. You should do this in two ways: (a) By using SVD directly. Do not use any PCA built-ins. (b) By using sklearn.decomposition.PCA. The two approaches should give exactly the same result, and this also acts as a check that you are doing the right thing. (But note that the signs of the singular vectors may be flipped in the two approaches since singular vectors are only determined uniquely up to sign. If this happens, flip signs to make everything identical again.) Your final goal is to make a scatterplot of the dataset in two dimensions, where the r-axis is the first principal component and the y-axis is the second. Color the points by their diagnosis 1 (malignant or benign). Do this for both approaches. Your plots should be identical. Does the data look roughly separable already in two dimensions

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

Why arent the other shipped orders without an invoice suspicious?

Answered: 1 week ago

Question

What is Constitution, Political System and Public Policy? In India

Answered: 1 week ago

Question

What is Environment and Ecology? Explain with examples

Answered: 1 week ago