PNMFfun | R Documentation |
Fast Projective Nonnegative Matrix Factorization Realizatiton based on Euclidean Distance / KL Divergence / Discriminant pNMF.
PNMFfun(
X,
K = 10,
tol = 0.001,
maxIter = 500,
verboseN = FALSE,
zerotol = 1e-10,
method = "EucDist",
label = NULL,
mu = 1,
lambda = 0.01,
seed = 123
)
X |
Input data matrix, where rows represent features (genes), columns represent samples (cells). |
K |
Specification of the factorization rank (number of low dimension). |
tol |
A threshold below which would be considered converged. Default is 1e-3. |
maxIter |
Number of max iteration times. Default is 500. |
verboseN |
A boolean value indicating whether to print number of iterations. |
zerotol |
A threshold on basis loadings below which would be considered zero. Default is 1e-10. |
method |
A character string indicating which method to be used. One of |
label |
A character vector indicating the cluster type for each cell. Required only when |
mu |
A numerical value which controls the penalty term. Larger |
lambda |
A numerical value which controls the magnituide of within class distances. Larger |
seed |
Random seed of the initialization. |
Given a data matrix (rows as features and columns as samples), this function
computes the Projective Nonnegative Matrix Factorization (PNMF). Based on different objective functions,
the choices are Euclidean distance ("EucDist"
), KL divergence ("KL"
) (Yang, Zhirong, and Erkki Oja. 2010), or Discriminant PNMF ("DPNMF"
) (Guan, Naiyang, et al. 2013).
"EucDist"
is supposed to be the most common one;
"KL"
is similar to KL-NMF (Poisson-NMF), and may work better for count data;
"DPNMF"
requires the predefined labels.
The fitting result of PNMF shares characteristics of both PCA and NMF. The model returns
a basis
matrix, which is similar to the loading matrix in PCA. However, notice that
unlike in PCA the first PC always represents the largest variation, each basis vectors are equal in PNMF.
A list with components:
Weight
The basis of model fit (W
).
Score
The mapped scores (W^TX
), which is the dimension reduced result.
Kexin Li, aileenlikexin@outlook.com
Dongyuan Song, dongyuansong@g.ucla.edu
Yang, Z., & Oja, E. (2010). Linear and nonlinear projective nonnegative matrix factorization. IEEE Transactions on Neural Networks, 21(5), 734-749.
Guan, N., Zhang, X., Luo, Z., Tao, D., & Yang, X. (2013). Discriminant projective non-negative matrix factorization. PloS one, 8(12), e83291.
data(zheng4)
X <- SummarizedExperiment::assay(zheng4, "logcounts")
res_pnmf <- scPNMF::PNMFfun(X = X,
K = 3,
method="EucDist",
tol=1e-4,
maxIter=100,
verboseN = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.