Question: ( b ) In this part, we do an experiment to explore the use of clustering for making predictions. [ 1 1 ] ( i
b In this part, we do an experiment to explore the use of clustering for making predictions.
i Write code to apply kmeans to cluster the scikitlearns breast cancer dataset see the loadbreastcancer function to clusters, using only the features but not the target. Also write code to for each of the resulting clusters, count the data points ie instances with target value and those with target value ; display the counts.
ii Notice that if the clusters have different majority target classes, the clustering scheme may be used for predicting a data point as the majority target class of the cluster that data point belongs to Compute the accuracy using the total count of the majority target classes and the total number of data points.
c Repeat part b using agglomerative hierarchical clustering instead of kmeans clustering.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
