Question: 6. K-means. You are given three data samples: (a) (8 points) We want to have K=2 cluster. After K-mean finishes on the above training data,

6. K-means. You are given three data samples: (a) (8 points) We want to have K=2 cluster. After K-mean finishes on the above training data, what are the centers of the two clusters? What is the equation for the boundary of the two clusters? (b) (7 points) Suppose you want to use clustering for outlier detection. You find cluster means i,i=1,,K on the training data. Then, given a new data x and a threshold t, you declare x an outlier if xit for all i. Complete the following function to implement the outlier detection on a matrix of data x. The output is out [i]=1 if the sample x[i,:] is an outlier, and out [i]=0 otherwise. You must specify the other inputs of your function. Avoid for loops for full credit. def outlier_detect( X,) : .. return out
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
