Description Usage Arguments Details Value Author(s) References Examples
kmeans example for using MLPACK with R.
1 | mlKmeans(X, y)
|
X |
data matrix. |
y |
number of clusters. |
This is a kmeans example using RcppMLPACK. It uses the Kmeans method in MLPACK and integrates with R.
mlKmeans
returns a list with cluster assignment:
For RcppMLPACK: Qiang Kou
For MLPACK: Ryan Curtin
MLPACK project: http://www.mlpack.org/
1 2 |
KMeans::Cluster(): converged after 6 iterations.
$clusters
[1] 3
$result
[,1]
[1,] 0
[2,] 0
[3,] 0
[4,] 0
[5,] 2
[6,] 2
[7,] 0
[8,] 2
[9,] 2
[10,] 2
[11,] 2
[12,] 2
[13,] 2
[14,] 0
[15,] 2
[16,] 2
[17,] 2
[18,] 2
[19,] 2
[20,] 0
[21,] 2
[22,] 2
[23,] 2
[24,] 2
[25,] 1
[26,] 1
[27,] 1
[28,] 1
[29,] 1
[30,] 1
[31,] 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.