Description Usage Arguments Details Creating objects from the Class Algorithm Methods (by generic) References See Also Examples
This class implements the Nonsmooth Nonnegative Matrix Factorization (nsNMF) model, required by the Nonsmooth NMF algorithm.
1 2 3 4 5 |
object |
an object of class |
W |
a optional matrix to use in the computation as the basis matrix in place of
|
H |
a optional matrix to use in the computation as the coefficient matrix in place of
|
S |
smoothing matrix to use instead of |
... |
other arguments passed to suitable methods such as |
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.
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:
W and H are such as in the standard model, i.e. non-negative matrices of dimension n x r and r x p respectively;
S is a r \times r square matrix whose entries depends on an extra parameter 0≤q θ ≤q 1 in the following way:
S = (1-θ)I + \frac{θ}{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 θ = 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.
Object of class NMFns
can be created using the standard way with
operator new
However, as for all NMF model classes – that extend class
NMF
, objects of class NMFns
should be
created using factory method nmfModel
:
new('NMFns')
nmfModel(model='NMFns')
nmfModel(model='NMFns', W=w, theta=0.3
See nmfModel
for more details on how to use the factory
method.
The Nonsmooth NMF algorithm uses a modified version of the multiplicative update equations in Lee & Seung's method for Kullback-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 the matrix W has been updated, each of its columns is scaled so that it sums up to 1.
show(object = NMFns)
: Show method for objects of class NMFns
fitted(object = NMFns)
: Compute estimate for an NMFns object, according to the Nonsmooth NMF model
(cf. NMFns-class
).
Extra arguments in ...
are passed to method smoothing
, and are
typically used to pass a value for theta
, which is used to compute
the smoothing matrix instead of the one stored in object
.
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.
Other NMF-model:
NMFOffset-class
,
NMFstd-class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # create a completely empty NMFns object
new('NMFns')
# create a NMF object based on random (compatible) matrices
n <- 50; r <- 3; p <- 20
w <- rmatrix(n, r)
h <- rmatrix(r, p)
nmfModel(model='NMFns', W=w, H=h)
# apply Nonsmooth NMF algorithm to a random target matrix
V <- rmatrix(n, p)
## Not run: nmf(V, r, 'ns')
# random nonsmooth NMF model
rnmf(3, 10, 5, model='NMFns', theta=0.3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.