O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

In this recipe, we demonstrate various state-of-the-art approaches to validate the generated clusters. First, we load the European protein intake dataset and normalize it. Then, we use the NbClust() function to identify the optimal number of clusters from the scaled protein data frame. The parameter of the NbClust function, max.nc, refers to the maximum number of clusters; min.nc refers to the minimum number of clusters. We then plot the optimal number of clusters for the protein intake dataset, which turns out to be k=3. More information about the parameters of the NbClust function can be found at https://www.rdocumentation.org/packages/NbClust/versions/3.0/topics/NbClust.

You can try out different combination of parameters ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required