Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Machine Learning

IEOR 4525

Homework 5

Due Date: Friday April 28, 2023, at 11:50PM

last updated on April 19, 2023

You should use a single Python Notebook  * .ipynb le. You should use the Markup format of the notebook for the theoretical results, and the Python script for the programming parts. Clearly state what question and what part of that question you are answering.

1.  For this exercise, you will use the Google Doodle data you used for home- work assignment 4, question 3.  Follow instructions of part a) of HW4, Q3a) and prepare the data.

1a)  Compute the complete PCA of the data set.  Then show the visu-

alization of the distribution of the variation ratios from the highest pixel to the lowest (similar to the one given in the scripts posted in the modules page.) Also, plot the cumulative variation ratios against the dimension.

1b)  Run the ordinary logistic regression on the full data, predict on both

the training and the test data, and record their accuracy. Then, from the PCA, use only those principal components that account for 85% of the variation of the data and run the simple logistic regression again.  Test for both training and test sets and state whether there is a significant difference between accuracy achieved on the full data, and the one achieved on the data truncated by PCA.

1c)  Use the 85% principal components and reconstruct the full data from

them. Show three randomly chosen examples, both the original doo- dle and the one reconstructed from the truncated principal compo- nents.  Next, find the top three doodles whose reconstructed version from the PCA has the largest Euclidean distance from their original doodle. Show these three doodles, showing both the original, and the reconstructed versions.  Do these three examples indicate anomalous doodles?

2.  For this exercise, take the test set of the Doodle data only.

2a)  Use the k-means method and cluster this data into 20 classes.  Use

five initializations.  For each cluster, choose 10 random pictures and plot them in a 20 X10 grid.  The doodles in a row must belong to a common cluster.

2b)  Repeat part 2a), but this time use Gaussian mixtures.

2c)  Find the top ve most anomalous” doodles using the mixture model

and plot them. Print their actual labels above the plot. Do these ve look particularly anomalous in your view?