init | R Documentation |
H
or prototype matrix W
.This function initialises the H_{n \times k}
matrix
or the W_{k \times p}
matrix to start the SSMF model.
This function is often used in conjunction with the function ssmf( ). Also, the code can be run separately from the function
ssmf( ). This function returns to simplex-structured soft membership matrix H
and prototype matrix W
.
init(
data = NULL,
k = NULL,
method = c("kmeans", "uniform", "dirichlet", "nmf")
)
data |
Data matrix or data frame. |
k |
The number of prototypes/clusters. |
method |
Character: 'kmeans', 'uniform', 'dirichlet' or 'nmf'. If there are more than one method, the default is selecting the first method in the vector. |
'kmeans': create the W
matrix using the centres of the kmeans output; create the H
matrix by converting the classification into a binary matrix.
'uniform': create the H
matrix by sampling the values from uniform distribution and making the rows of the matrix lie in the unit simplex; group the observations with their maximum memberships
and create the W
matrix by combining the mean vector in each group.
'dirichlet': create the H
matrix by sampling the values from Dirichlet distribution; group the observations with their maximum memberships
and create the W
matrix by combining the mean vector in each group.
'nmf': create the W
matrix using the matrix of basic components from NMF model; the coefficient matrix is acquired from NMF model,
then the H
is created by making the rows of the coefficient matrix lie in the unit simplex.
Initialised H
, W
matrix.
Wenxuan Liu
# example code
init(data = SimulatedDataset, k = 4, method = 'kmeans')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.