Learn R Programming

NMF (version 0.5.06)

NMFns-class: Nonsmooth Nonnegative Matrix Factorization

Description

Class that implements the Nonsmooth Nonnegative Matrix Factorization (nsNMF) model, required by the Nonsmooth NMF algorithm. The Nonsmooth NMF algorithm is defined by Pascual-Montano et al. (2006) as a modification of the standard divergence based NMF algorithm (see section Details and references below). It aims at obtaining sparser factor matrices, by the introduction of a smoothing matrix.

Usage

## S3 method for class 'NMFns':
fitted(object, W, H, S, ...)
## S3 method for class 'NMFns':
smoothing(x, theta)

Arguments

x
an object of class NMFns
object
an object of class NMFns
W
the matrix of basis vectors, i.e. the first matrix factor in the non-smooth NMF model.
H
the matrix of mixture coefficients, i.e. the third matrix factor the non-smooth NMF model.
S
the smoothing matrix, i.e. the middle matrix factor in the non-smooth NMF model.
theta
a single numeric
...
extra parameters passed to method smoothing. So typically used to pass a value for theta.

Algorithm

The Nonsmooth NMF algorithm uses a modified version of the multiplicative update equations in Lee & Seung's method for Kullbach-Leibler divergence minimization. The update equations are modified to take into account the -- constant -- smoothing matrix. The modification reduces to using matrix $W S$ instead of matrix $W$ in the update of matrix $H$, and similarly using matrix $S H$ instead of matrix $H$ in the update of matrix $W$. After matrix $W$ have been updated, each of its columns is scaled so that it sums up to 1.

Objects from the Class

Object of class NMFns can be created using the standard way with operator new However, as for all the classes that extend class NMFstd, objects of class NMFns should be created using factory method nmfModel : new('NMFns', theta=0.8) nmfModel(model='NMFns') nmfModel(model='NMFns', theta=0.8) See nmfModel for more details on how to use the factory method.

Extends

Class "NMF", directly.

Details

The Nonsmooth NMF algorithm is a modification of the standard divergence based NMF algorithm (see NMF). Given a non-negative $n \times p$ matrix $V$ and a factorization rank $r$, it fits the following model: $$V \equiv W S(\theta) H,$$ where:
  • $W$and$H$are such as in the standard model, that is non-negative matrices of dimension$n \times r$and$r \times p$respectively;
  • $S$is a$r \times r$square matrix whose entries depends on an extra parameter$0\leq \theta \leq 1$in the following way:$$S = (1-\theta)I + \frac{\theta}{r} 11^T ,$$where$I$is the identity matrix and$1$is a vector of ones.
The interpretation of S as a smoothing matrix can be explained as follows: Let $X$ be a positive, nonzero, vector. Consider the transformed vector $Y = S X$. If $\theta = 0$, then $Y = X$ and no smoothing on $X$ has occurred. However, as $\theta \to 1$, the vector $Y$ tends to the constant vector with all elements almost equal to the average of the elements of $X$. This is the smoothest possible vector in the sense of non-sparseness because all entries are equal to the same nonzero value, instead of having some values close to zero and others clearly nonzero.

References

Alberto Pascual-Montano et al. (2006). Nonsmooth Nonnegative Matrix Factorization (nsNMF). IEEE Transactions On Pattern Analysis And Machine Intelligence , Vol. 28, No. 3, March 2006 403

See Also

NMF , nmf-methods

Examples

Run this code
# create a completely empty NMF object
new('NMFns')

# create a NMF object based on random (compatible) matrices
n <- 50; r <- 3; p <- 20
w <- matrix(runif(n*r), n, r) 
h <- matrix(runif(r*p), r, p)
nmfModel(model='NMFns', W=w, H=h)

# apply Nonsmooth NMF algorithm to a random target matrix
V <- matrix(runif(n*p), n, p)
nmf(V, r, 'ns')

Run the code above in your browser using DataLab