Learn R Programming

nnmf (version 1.1)

init: Initialization strategies for the NMF based on the k-means

Description

Initialization strategies for the NMF based on the k-means algorithm.

Usage

init(x, k, bs = 1, veo = FALSE)

Value

W

The \(W\) matrix, an \(n \times k\) matrix with the mapped data.

H

The \(H\) matrix, an \(k \times D\) matrix.

Z

The reconstructed data, \(Z = WH\).

obj

The reconstruction error, \( ||x - Z||_F^2\).

error

If the argument history was set to TRUE the reconstruction error at each iteration will be performed, otherwise this is NULL.

iters

The number of iterations performed.

runtime

The runtime required by the algorithm.

Arguments

x

An \(n \times D\) numerical matrix with data.

k

The number of lower dimensions. It must be less than the dimensionality of the data, at most \(D-1\).

bs

The batch size in case the user wants to use the mini-batch k-means algorithm. If bs=1, the classical k-means is used.

veo

If the (number of) variables exceed the (number of) observations set this equal to true. In this case, the sparse k-means algorithm of Witten and Tibshirani (2010) is used to initiate the H matrix.

Author

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Details

Nonnegative matrix factorization using quadratic programming is performed. The objective function to be minimized is the square of the Frobenius norm.

References

Alenazi A. and Tsagris M. (2026). Simplicial nonnegative matrix factorization. In preparation.

Witten D. M. and Tibshirani R. (2010). A framework for feature selection in clustering. Journal of the American Statistical Association, 105(490): 713--726.

Cutler A. and Breiman L. (1994). Archetypal analysis. Technometrics, 36(4): 338--347.

See Also

nmf.qp

Examples

Run this code
x <- as.matrix(iris[, 1:4])
mod <- nmf.qp(x, 2)
plot(mod$W, colour = iris[, 5])

Run the code above in your browser using DataLab