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 to do it...

Perform the following steps to perform model-based clustering:

  1. First, install and load the following package:
install.packages("mclust")library(mclust)
  1. Then, perform model-based clustering on the multishapes dataset:
> mm = Mclust(dataPoints)
  1. Now plot the result and press 1 to obtain the BIC against a number of components:
> plot(mm)
  1. Next, press 2 to show the classification with respect to different combinations of features:
  1. Then, press 3 to show the classification uncertainty with respect to different feature combinations: ...

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