predict: Clustering and Prediction

Description Usage Arguments Details Methods (by generic) References Examples

Description

The methods predict for NMF models return the cluster membership of each sample or each feature. Currently the classification/prediction of new data is not implemented.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
predict(object, ...)

## S4 method for signature 'NMF'
predict(
  object,
  what = c("columns", "rows", "samples", "features"),
  prob = FALSE,
  dmatrix = FALSE
)

## S4 method for signature 'NMFfitX'
predict(
  object,
  what = c("columns", "rows", "samples", "features", "consensus", "chc"),
  dmatrix = FALSE,
  ...
)

Arguments

object

an NMF model

...

other arguments passed to suitable methods, like predict,NMF-method.

what

a character string that indicates the type of cluster membership should be returned: ‘columns’ or ‘rows’ for clustering the colmuns or the rows of the target matrix respectively. The values ‘samples’ and ‘features’ are aliases for ‘colmuns’ and ‘rows’ respectively.

prob

logical that indicates if the relative contributions of/to the dominant basis component should be computed and returned. See Details.

dmatrix

logical that indicates if a dissimiliarity matrix should be attached to the result. This is notably used internally when computing NMF clustering silhouettes.

Details

The cluster membership is computed as the index of the dominant basis component for each sample (what='samples' or 'columns') or each feature (what='features' or 'rows'), based on their corresponding entries in the coefficient matrix or basis matrix respectively.

For example, if what='samples', then the dominant basis component is computed for each column of the coefficient matrix as the row index of the maximum within the column.

If argument prob=FALSE (default), the result is a factor. Otherwise a list with two elements is returned: element predict contains the cluster membership index (as a factor) and element prob contains the relative contribution of the dominant component to each sample (resp. the relative contribution of each feature to the dominant basis component):

Methods (by generic)

References

Brunet J, Tamayo P, Golub TR, Mesirov JP (2004). “Metagenes and molecular pattern discovery using matrix factorization.” _Proceedings of the National Academy of Sciences of the United States of America_, *101*(12), 4164-9. ISSN 0027-8424, doi: 10.1073/pnas.0308531101 (URL: https://doi.org/10.1073/pnas.0308531101).

Pascual-Montano A, Carazo JM, Kochi K, Lehmann D, Pascual-marqui RD (2006). “Nonsmooth nonnegative matrix factorization (nsNMF).” _IEEE Trans. Pattern Anal. Mach. Intell_, *28*, 403-415.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# random target matrix
v <- rmatrix(20, 10)
# fit an NMF model
x <- nmf(v, 5)
 
# predicted column and row clusters
predict(x)
predict(x, 'rows')

# with relative contributions of each basis component
predict(x, prob=TRUE)
predict(x, 'rows', prob=TRUE)

renozao/NMF documentation built on June 14, 2020, 9:35 p.m.