Question: SHOW ALL STEPS AND COMMENT ALL CODE: (a) [marks: 10] Obtain two PCA principal components from the sonar dataset (https://archive.ics.uci.edu/m//machine-learning-databases/undocumented//connectionist-bench/sonar/sonar.all-data) and print the explained variance
SHOW ALL STEPS AND COMMENT ALL CODE:
![SHOW ALL STEPS AND COMMENT ALL CODE: (a) [marks: 10] Obtain two](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/6718e63c92cd4_0526718e63c25a7f.jpg)
(a) [marks: 10] Obtain two PCA principal components from the sonar dataset (https://archive.ics.uci.edu/m//machine-learning-databases/undocumented//connectionist-bench/sonar/sonar.all-data) and print the explained variance ratio. (b) [marks: 20] Generate a scatter graph of the two principal components. (c) [bonus marks: 5] Embellish your graph by using marker ' ' for mines and marker ' v ' for rocks. (d) [bonus marks: 10] Use KMeans(n_clusters=2, max_iter=100, init='random') to obtain two clusters off the original data (not from the PCA components) and embellish your graph using contour colours splitting the two K-Means clusters. Submit your Python code (either sonar.py or sonar.ipynb; submitting a link to a notebook will be considered a void submission) with your name in the Honour Code at the top of your program. (a) [marks: 10] Obtain two PCA principal components from the sonar dataset (https://archive.ics.uci.edu/m//machine-learning-databases/undocumented//connectionist-bench/sonar/sonar.all-data) and print the explained variance ratio. (b) [marks: 20] Generate a scatter graph of the two principal components. (c) [bonus marks: 5] Embellish your graph by using marker ' ' for mines and marker ' v ' for rocks. (d) [bonus marks: 10] Use KMeans(n_clusters=2, max_iter=100, init='random') to obtain two clusters off the original data (not from the PCA components) and embellish your graph using contour colours splitting the two K-Means clusters. Submit your Python code (either sonar.py or sonar.ipynb; submitting a link to a notebook will be considered a void submission) with your name in the Honour Code at the top of your program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
