
168 Text Mining and Visualization: Case Studies Using Open-Source Tools
iteration. To do this, simply repeat Step 2 nine times, selecting XMeans in Step 2.3 and
varying k from 2 to 10 on each iteration. When we plot the output as a chart, we see a
function similar to that shown in Figure 7.15.
FIGURE 7.15: Sum of squared errors by k for 100,000 filtered sessions from AOL.
As we can see, there is an elbow around k = 4 and another around k = 7. This implies
that either of these two values may be good choices for a local optimum. We have already
seen the output for k = 7 (which is the optimum that XMeans found), so now we repeat
Step 2 with kMeans and