Learn R Programming

MetabolSSMF (version 0.1.0)

init: Initialise the membership matrix \(H\) or prototype matrix \(W\).

Description

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\).

Usage

init(
  data = NULL,
  k = NULL,
  method = c("kmeans", "uniform", "dirichlet", "nmf")
)

Value

Initialised \(H\), \(W\) matrix.

Arguments

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.

Author

Wenxuan Liu

Details

'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.

Examples

Run this code
# example code
# \donttest{
init(data = SimulatedDataset, k = 4, method = 'kmeans')
# }

Run the code above in your browser using DataLab