# Clustering to minimize variance and maximize frequency in the cluster

It doesn't matter what clustering algorithm it is. Let's say I have data in a 2 dimensional (X Y) space. I want to tune (select parameters in) my clustering algorithm so that I minimize the variance in each cluster, and maximize the number of points in the cluster. Basically, I want a tight fit.

For example, having only 2 items (which are very close to each other) in each cluster is bad. Even though the variance is small, the count is low. At the same time, having many items in each cluster is good, but it may have a larger variance.

I'm not sure how to make a scoring function where I somehow incorporate the covariance / mean of each cluster created, and the amount of items in each cluster.

• minimize the variance in each cluster, and maximize the number of points in the cluster. But isn't the number of points already a denominator of the variance? Minimizing variance objective is minimizing SSwithin and maximizing n. There exist variance minimizing hierarchical clustering method, known by abbreviation MNVAR (not to be confused with Ward's method). Or you might wish to add more weight to the n in the denominator by, say, squaring it, n^2, and modify the MNVAR method code accordingly. You can even modify K-means so that it will minimize SSw with an eye on n in cluster. Mar 10 '16 at 22:22