Answered step by step
Verified Expert Solution
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!
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 dimensionsStep 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