py4sci

Previous topic

Hierarchical clustering

Next topic

LASSO

This Page

Model-based clusteringΒΆ

    iris = read.table("http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data",
        sep = ",", header = FALSE)
    names(iris) = c("sepal.length", "sepal.width", "petal.length", "petal.width",
        "iris.type")

    library(mclust)
    iris_mclust = Mclust(iris[, -5], G = c(1:10))
    print(iris_mclust)

    ## 'Mclust' model object:
    ##  best model: ellipsoidal, equal shape (VEV) with 2 components

    plot(iris_mclust, "BIC")

_images/model_cluster_fig_00.png
    plot(iris_mclust, "classification")

_images/model_cluster_fig_01.png