CSC546 Homework 1

$30.00

Category: Tags: , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (3 votes)

Part I
Basic Concepts in Linear Algebra and Calculus
1. We have two vectors, π‘₯π‘₯1 and π‘₯π‘₯2
π‘₯π‘₯1 = οΏ½
1
2
οΏ½ and π‘₯π‘₯2 = οΏ½
10
18οΏ½
What is the distance between π‘₯π‘₯1 and π‘₯π‘₯2 ?
(1) if the distance measure is based on L2 norm (a.k.a Euclidean norm)
(2) if the distance measure is based on L1 norm
(3) if the distance measure is based on L∞ norm (a.k.a infinity norm)
Assuming there are two feature components π‘₯π‘₯ = οΏ½
𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖
𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 οΏ½ in an application, does the L∞ norm-based
distance measure make sense for the application of customer segmentation?
2. We define a scalar valued function of a vector variable
𝑓𝑓(π‘₯π‘₯) = π‘₯π‘₯𝑇𝑇𝐴𝐴𝐴𝐴
Here, π‘₯π‘₯ is a column vector, π‘₯π‘₯𝑇𝑇 is the transpose of π‘₯π‘₯, and 𝐴𝐴 is a symmetric matrix
To simplify this question, let’s assume π‘₯π‘₯ has only two elements π‘₯π‘₯ = οΏ½
𝛼𝛼
𝛽𝛽�, and 𝐴𝐴 = οΏ½
π‘Žπ‘Ž 𝑐𝑐
𝑐𝑐 𝑏𝑏�
The derivative of 𝑓𝑓 with respect to π‘₯π‘₯ is a vector defined by 𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑 = οΏ½
𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑�
Show that 𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑 = 2𝐴𝐴π‘₯π‘₯
Hint: calculate 𝑓𝑓(π‘₯π‘₯), 2𝐴𝐴𝐴𝐴,
𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑 and 𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑
K-means clustering
3. Briefly describe the two key steps in one iteration of the k-means algorithm.
4. What is the distance measure used in k-means (implemented in sk-learn)?
5. The k-means algorithm can converge in a finite number of iterations. Why?
6. The clustering result of k-means could be random. Why?
7. The minimum value of the objective/loss function is zero for any dataset. What is the clustering result
when the objective function is zero?
Note: for questions 3,4,5,6,7, you only need to write a few words (bullet points) for each one.
You may write the answers on a piece of paper, take a photo using your cell phone, and upload the picture
to Blackboard. Make sure that your handwriting is human-readable.
You may use MS-word to write the answers, convert the file to PDF, and upload it to Blackboard.
Part 2: Programming
Complete the tasks in the files:
H1P2T1_kmeans.ipynb
If you want to get some bonus points, try this task:
H1P2T2_kmeans_compression.ipynb
Grading: the number of points
Undergraduate Student Graduate Student
Basic Concepts in Linear Algebra
and Calculus
10 10
K-means clustering 10 10
H1P2T1 30 30
H1P2T2 10 (bonus) 10 (bonus)
Total number of points 50 + 10 50+10
Upload your files (*_your_name.ipynb) to blackboard
Do NOT covert the ipynb files to pdf.