Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Linear Algebra, Python is being used in this class. Numpy, sklearn, pandas can be used, below are notes that might contextualize the problems above. II.
Linear Algebra, Python is being used in this class. Numpy, sklearn, pandas can be used, below are notes that might contextualize the problems above.
II. K-Means The following are vectors in R2 that we wish to group using the K-Means algorithm. x0=0,1,x1=1,1,x2=0,0,x3=4,5,x4=5,3,x5=0,7 Exercise 5. Suppose group representative vectors are randomly assigned to be z0=x0,z1=x1, and z2=x4. This implies that there are total groups. Exercise 6. Calculate and report the initial J0clust that results from the representative vectors in the previous exercise. (Hint: do this by hand like we did in class.) Exercise 7. Now, run the K-means algorithm once (that is, complete the steps a single time). The updated version of the third group representative is now z2=[,]. Exercise 8. The final optimal grouping once the K-Means algorithm has converged has a Jclust value of . (Hint: this is lowest value Jclust can achieve for this initial grouping.) Exercise 9. If we wanted a Jclust of 0 we could make this happen by choosing k=. . (Hint: look at the numerator of Jclust and think about how to get each piece to be 0 . Also, just because this is possible doesn't mean it's a good idea.) More formally, if z1,,zk are the group centroid vectors with j1,,k, and ci=j, we define the objective function as Jclust=(x1zc12+x2zc22++xnzcn2) We have found an "optimal" grouping when Jclust is minimized. We can miminize Jclust by minimizing each inidividual xizci. Thus, the optimal grouping solution is found by minj=1,2,,kx1zj+minj=1,2,,kx2zj++minj=1,2,,kxnzj K-Means Clustering Algorithm: 1. Choose k, the number of groups. Randomly initialize k centroids. 2. Compute the Euclidian distance between each data observation (vector) and each of the k centroids. 3. Assign each vector to the group with the closest centroid. 4. Update each centroid as the average of all vectors assigned to that centroid's group. 5. Repeat steps 2-4 until convergenceStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started