This assignment covers the essential mathematical and statistical foundations required for a comprehensive understanding of machine learning. It emphasizes Linear Algebra, Probability theory, Maximum Likelihood Estimation (MLE), Maximum a Posteriori (MAP) estimation, and Principal Component Analysis (PCA). A strong grasp of these mathematical tools is essential for advancing to more sophisticated machine learning topics.
Refer to the following slides provided in class for detailed explanations:
Lecture1_introLecture2_review
In this assignment, you will:
- Solve detailed problems in Linear Algebra involving vectors, matrices, eigenvectors, and eigenvalues.
- Derive solutions and perform calculations related to Probability, MLE, and MAP estimations.
- Integrate mathematical understanding with practical programming in PCA.
Grading will be done by the TA. The assignment is worth 100 points, divided as: 20 for linear algebra, 50 for probability and estimation, and 30 for PCA. Please submit the final assignment to Canvas.
Q1 (5 points). Given matrices:
Compute:
Q2 (5 points). For the following matrix:
Calculate the eigenvalues and eigenvectors. Verify your solution by showing
Q3 (5 points). Prove the following property of the trace operator:
Q4 (5 points). Show step-by-step that the inverse of the matrix
exists, and compute its inverse.
Q1 (10 points). Suppose a random variable
(a) Find the normalization constant
(b) Compute the expectation
Q2 (15 points). Given two events
(a)
(b)
(c)
Q3 (10 points). Suppose you have a biased coin with unknown probability of heads
(a) Derive the Maximum Likelihood Estimate (MLE) for
(b) Compute the Maximum a Posteriori (MAP) estimate for
Q4 (5 points). Consider a Gaussian distribution with parameters
Q5 (5 points). You observe samples drawn from a Gaussian distribution with unknown mean
derive the MAP estimate of
Q6 (Variance Expansion Proof, 5 points). Prove the variance expansion identity:
Q1 (10 points). Given a dataset represented by a random vector
Document each intermediate mathematical step and define the covariance matrix
Q2 (5 points). Generate a synthetic 2-dimensional dataset composed of two correlated Gaussian features. Use NumPy for data generation. Visualize this dataset with scatter plots and discuss the correlation structure observed.
Q3 (10 points). Implement PCA from scratch using NumPy. Follow these steps:
- Center your dataset (mean subtraction).
- Compute the covariance matrix.
- Find eigenvalues and eigenvectors of the covariance matrix.
- Select the principal components corresponding to the highest eigenvalues.
Document each step in your implementation, linking it to your mathematical derivation from Q1. Provide visualizations of your original data along with identified principal component directions.
Q4 (10 points). Compute the proportion of total variance explained by each principal component. Discuss the results and explain the significance of dimensionality reduction. Provide insights into the trade-off between explained variance and dimensionality reduction.
Submit to Canvas by the deadline:
- Derivations as PDF (handwritten or typed).
- Python code in documented Jupyter Notebooks or python code.
- Visualizations and analyses with notebooks (or printed in pdf).
Per the course AI policy, AI usage is allowed on this assignment as long as you submit the conversation log to Canvas.
Good luck!