Model Clustering
- Mclust::mclust
- Rweka::cobweb
Mclust::mclust
The EM algorithm is also called the expectation maximization algorithm, when using the algorithm clustering, the data set is regarded as a probabilistic model with stealth variables, and the optimization of the model, that is, to obtain the most suitable clustering method with the nature of the data, to find the optimal solution by ' repeated estimation ' model parameters, and to give the corresponding most class series K
Required Program installation package
Install.packages ("mclust")
Function Sample Code
>Library (mclust)> Em<-mclust (iris[,-5])> Summary (em,parameters=T)----------------------------------------------------Gaussian finite mixture model fitted by EM algorithm----------------------------------------------------mclust Vev (ellipsoidal, equal shape) model with2components:log.likelihood N DF BIC ICL-215.726 150 26-561.7285-561.7289Clustering Table:1 2 50 100Mixing probabilities:1 2 0.333332 0.666668Means: [,1] [, 2]sepal.length5.0060021 6.261996Sepal.width3.4280046 2.871999Petal.length1.4620006 4.905993Petal.width0.2459998 1.675997
You can see that the optimal class progression is 2, each of which contains 50,100,
Mclust::p lot. Mclust (em,what = "Classification")
Mclust::p lot. Mclust (em,what = "Density")
Rweka::cobweb
Cobweb is a popular simple incremental concept clustering algorithm. It creates hierarchical clusters in the form of a classification tree, each of which corresponds to a concept that contains a probabilistic description of the concept, outlining the objects that are divided under that node. To make the function, you need to install the Rweka package, during the installation process, the following exceptions may occur
**R**Inst* * Preparing Package forlazy Loadingerror:. OnLoad failedinchLoadnamespace () for 'Rjava', Details:call:fun (Libname, pkgname) Error:java_home cannot be determined fromThe Registryerror:lazy loading failed forPackage'Rweka'* Removing'C:/users/zhushy/documents/r/win-library/3.2/rweka'
Installing JRE, reference: http://blog.csdn.net/afei__/article/details/51464783
Rweka Package not successfully installed, sample code not validated , pending confirmation
Library (Rweka) DCOM=iris[,-5]c1<-cobweb (DCOM) c1c1$class_idstable (Predict (C1), Dcom$clas )
Resources:
- Https://cran.r-project.org/web/packages/mclust/index.html
- https://www.douban.com/note/495288321/
ML: Clustering algorithm R packet-model clustering