NMFns-class {NMF} | R Documentation |
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.
## S4 method for signature 'NMFns': fitted(object, W, H, S, ...) ## S4 method for signature 'NMFns': smoothing(x, theta)
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 . |
The Nonsmooth NMF algorithm is a modification of the standard divergence based
NMF algorithm (see NMF
).
Given a non-negative n x p matrix V and a factorization rank
r, it fits the following model:
V ~ W S(theta) H,
where:
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 tends 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.
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.
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
newNMF
:
new('NMFns', theta=0.8)
newNMF(model='NMFns')
newNMF(model='NMFns', theta=0.8)
See newNMF
for more details on how to use the factory method.
Class NMFns
extends NMF
adding a single slot:
theta
:"numeric"
that contains the smoothing
parameter. Default prototype value is 0.5
.
Class "NMF"
, directly.
signature(object = "NMFns")
:
returns the estimated target matrix according to the Nonsmooth-NMF model
object
:
\hat{V} = \hat{V}(\theta) = W S(\theta) H
Note that this method is part of the minimum interface for NMF model, as
defined by class NMF
.
signature(object = "NMFns")
: standard generic show
method for objects of class NMFns
. It calls the parent class show
method
(i.e. for class NMF
) and add the value of parameter theta
to the display.
Renaud Gaujoux renaud@cbio.uct.ac.za
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
# 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) newNMF(model='NMFns', W=w, H=h) # apply Nonsmooth NMF algorithm to a random target matrix V <- matrix(runif(n*p), n, p) ## Not run: nmf(V, r, 'ns')