Reputation: 41
How would you work out the sqared error for this examples of using the k-mean algorithm by hand?
I'm trying to work-out how to use squared error for a particular set of data.
So I want to know how they got the values for squared error as "14.5","15.94" and "9.60"
I understand that the cluster centers are the mean of the cluster point values for x and y and cluster points are each of the instances. But I do not understand how they worked out the squared error.
Upvotes: 0
Views: 6153
Reputation: 79461
The "squared error" for a point P with respect to its cluster center C is the distance between P and C squared; that is, (Px - Cx)^2 + (Py - Cy)^2.
The squared error for the entire clustering is the sum of this calculation over all points. For example, the squared error for outcome 1 is computed as follows.
Px Cx Py Cy
(1.0 - 2.67)^2 + (4.5 - 4.67)^2
+ (2.0 - 2.67)^2 + (3.5 - 4.67)^2
+ (5.0 - 2.67)^2 + (6.0 - 4.67)^2
+ (1.0 - 2.00)^2 + (1.5 - 1.83)^2
+ (2.0 - 2.00)^2 + (1.5 - 1.83)^2
+ (3.0 - 2.00)^2 + (2.5 - 1.83)^2
Upvotes: 2