You are on page 1of 2

151

x2

x4 x1

x3

Figure 2. The intended behaviour of a gradually increasing penalty term.

The addition of a penalty term to the assignment function of the standard k-means algorithm follows
the approach of [29] and [30]. The crucial point, in which we deviate from their method, is the
determination of the penalty term. An appropriate value of the penalty term is essential for the algorithm
in order to produce reasonable results, but it strongly depends on the given data set.

3.1. Increasing penalty term


We address this problem by introducing an increasing penalty term. The idea is to start with a
clustering produced by the standard k-means algorithm that yields a reasonably good clustering quality
in minimizing the SSE, and use a gradually increasing penalty term to shift the focus towards the
balance. Figure 2 illustrates this intended behaviour. The initial solution contains two clearly separated
clusters. When the penalty term is increased once, only the point x1 joins the cluster on the right. After
subsequent increases in the penalty term, also points x2 , x3 and x4 join the rightmost cluster. In this way,
the balance quality increases while the clustering quality decreases. The algorithm terminates as soon
as the desired balance requirement is met.
Following this approach, we further avoid using a non-intuitive parameter that determines the
trade-off between the clustering and the balance quality like many soft-balanced clustering algorithms
do [8, 29, 32]. Instead, the balance degree is determined by the time of termination, for which a criterion
in form of a balance requirement can be given (see Section 5.2 for different ways to measure the balance
quality). Thus, if, for example, a user wishes to reach a certain maximum difference between the
smallest and the largest cluster, the algorithm will continue until such a clustering is reached. Therefore,
this approach represents a very intuitive way of defining the trade-off between clustering and balance
performance.
Formally, we seek a penalty term contingent on both cluster size and the number of iterations.
Therefore, we introduce the function scale, a strictly increasing function depending on the number of
iterations, and define

penalty( j, iter) = scale(iter) · n j .

As the value of the function scale becomes steadily larger with the number of iterations, the influence of
the cluster sizes increases relative to the error term SSE in each iteration. By introducing the dependency
of the penalty term on the number of iterations, the objective function also becomes dependent on the
number of iterations.

Applied Computing and Intelligence Volume 3, Issue 2, 145–179


152

3.2. Scaling the penalty term


One of the easiest ways to define the function scale consists of choosing it as a classical function
like a logarithmic, linear, quadratic, or exponential function. However, the problem with using one of
these functions is the uniqueness of each data set. Using an increasing penalty term does not mean that
we no longer have to be concerned about the appropriate magnitude of the penalty term.
If the penalty term is too small, it takes a very long time to reach a balanced clustering. On the other
hand, if the term becomes too large too fast, overlapping clusters are produced. This can be seen as
follows: In Figure 2, in the optimum case in one iteration the penalty term is large enough such that
point x1 changes to the smaller cluster on the right, but the term is not large enough to make the points
x2 , x3 and x4 change to the cluster on the right. In the next iteration, the penalty term increases such
that also the points x2 and x3 change to the cluster on the right, but still the penalty term is not large
enough to make point x4 change to the cluster on the right. In the next iteration, the penalty term further
increases such that now also point x4 changes to the cluster on the right. However, if the penalty term
increases too fast, for example, if points x1 and x4 can change to the cluster on the right in the same
iteration for the first time, it can happen that x4 changes to the cluster on the right, but x1 does not. Then,
overlapping clusters are formed.
Therefore, the size and growth of the penalty term are critical, and due to the uniqueness of each
data set, one data set may require a smaller penalty term, while other data sets need larger penalties and
the required growth of the penalties can also differ.
Thus, we take a slightly more complicated approach than using a classical function, but also a more
effective approach. The main principle is that progress in producing a more balanced clustering out of
an unbalanced one happens only when a data point changes from a larger to a smaller cluster. Thus, the
value of scale should be large enough to make a data point change from a larger to a smaller cluster. At
the same time, it should not be chosen too large to preserve a good clustering quality, since a rapidly
increasing penalty term tends to lead to overlapping clusters.
This seems to be a high demand for the value of scale, but indeed, during one iteration of the
algorithm, we can compute the minimum value of the penalty term for the next iteration that is necessary
to make at least one data point change to a smaller cluster.
Let us start simple: We assume that we are in iteration iter in the assignment phase of data point xi
and its old cluster is denoted by jold . Then, data point xi is able to change to cluster jnew containing less
data points, n jnew < n jold , only if
||xi − c jnew ||2 + penalty( jnew , iter) < ||xi − c jold ||2 + penalty( jold , iter)
⇔ ||xi − c jnew ||2 − ||xi − c jold ||2 < penalty( jold , iter) − penalty( jnew , iter)
⇔ 2
||xi − c jnew || − ||xi − c jold || 2
< scale(iter) · n jold − scale(iter) · n jnew (3)
||xi − c jnew ||2 − ||xi − c jold ||2
⇔ < scale(iter).
n jold − n jnew
Note that the last equivalence relies on our assumption
n jnew < n jold .
First, if inequality 3 holds, data point xi can change to cluster jnew . This does not imply that xi will
indeed change to cluster jnew , because there can be another cluster that leads to an even smaller cost
term. However, point xi will change its cluster.

Applied Computing and Intelligence Volume 3, Issue 2, 145–179

You might also like