# SSE not decreasing with increase in number of clusters

So as far as I know, SSE should decrease( or just never increases) as the number of clusters increases.

I have an implementation of K-means where the parameter k was supplied as 5,10,15,20,25 and 30 for every different run of the K-means. So at the end of each run, the number of clusters reported was 2,5,8,3,5 and 7

Sum Of Squared Error(SSE) was calculated for each of the runs.

SSE for k=5(2) was 41695.147

SSE for k=10(5) was 43016.033

SSE for k=15(8) was 48692.344

SSE for k=20(3) was 41440.441

SSE for k=25(5) was 45485.315

SSE for k=30(7) was 40871.851

The graph below is plotted for number of clusters reported by K-means vs SSE.

This isn't supposed to happen right?

UPDATE:

data_attributes = (float, nominal, nominal)

calculation of distance:

point_1 = (2, 'apple', 'car')

point_2 = (4, 'banana', 'car')

dist(point_1, point_2) = (2 + 1 + 0) = 3

for float attribute: Simple euclidean distance between (2 and 4) = 2

for nominal attribute: if same values, then zero else one. So ('apple' and 'banana') = 1 and ('car' and 'car') = 0

Is this distance calculation the culprit?

• See related stats.stackexchange.com/q/159166/3277 Aug 18, 2019 at 10:57
• @ttnphns That cleared up the doubt. Aug 18, 2019 at 16:22