Comparing clustering methods

After fitting data into clusters using different clustering methods, you may wish to measure the accuracy of the clustering. In most cases, you can use either intracluster or intercluster metrics as measurements. We now introduce how to compare different clustering methods using cluster.stat from the fpc package.

Getting ready

In order to perform a clustering method comparison, one needs to have the previous recipe completed by generating the customer dataset.

How to do it...

Perform the following steps to compare clustering methods:

  1. First, install and load the fpc package:
    > install.packages("fpc")
    > library(fpc)
    
  2. You then need to use hierarchical clustering with the single method to cluster customer data and generate the ...

Get R: Recipes for Analysis, Visualization and Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.