Skip to contents

Non-negative Matrix Factorization

Core NMF functions and model class

nmf()
Non-negative matrix factorization
nmf-class
nmf S4 Class
subset(<nmf>) `[`(<nmf>,<ANY>,<ANY>,<ANY>) head(<nmf>) show(<nmf>) dimnames(<nmf>) dim(<nmf>) t(<nmf>) sort(<nmf>) prod(<nmf>) `$`(<nmf>) coerce(<nmf>,<list>) `[[`(<nmf>) predict(<nmf>)
nmf class methods
summary(<nmf>) plot(<nmfSummary>)
Summarize NMF factors
biplot(<nmf>)
Biplot for NMF factors
nnls()
Non-negative Least Squares Projection
compute_target()
Compute a Target Matrix for Guided NMF
refine()
Refine an NMF Model Using Label-Guided Correction

Singular Value Decomposition

SVD and PCA functions

svd()
Truncated SVD / PCA with constraints and regularization
`[`(<svd>,<ANY>,<ANY>,<ANY>) head(<svd>) show(<svd>) dim(<svd>) reconstruct() predict(<svd>) variance_explained()
svd S4 Class
pca()
PCA (centered SVD)

Model Evaluation & Diagnostics

Functions for evaluating and comparing NMF models

assess()
Assess Embedding Quality
as.data.frame(<nmf_assessment>)
Convert assessment results to a one-row data frame
print(<nmf_assessment>)
Print method for nmf_assessment objects
evaluate()
Evaluate an NMF model
sparsity()
Compute the sparsity of each NMF factor
align()
Align two NMF models
compare_nmf()
Compare Multiple NMF Models
cosine()
Cosine similarity

Distribution Selection

Automatic distribution and zero-inflation diagnostics

auto_nmf_distribution()
Auto-select NMF distribution
score_test_distribution()
Score-test distribution diagnostic
diagnose_zero_inflation()
Diagnose zero inflation
diagnose_dispersion()
Diagnose dispersion mode

Visualization

Plotting functions for NMF results

plot(<nmf>)
Plot NMF Training History and Diagnostics
plot(<nmfCrossValidate>)
Plot Cross-Validation Results

Consensus Clustering

Multi-replicate consensus NMF

consensus_nmf()
Consensus Clustering for NMF
plot(<consensus_nmf>)
Plot Consensus Matrix Heatmap
summary(<consensus_nmf>)
Summary for Consensus NMF

Clustering

NMF-based clustering algorithms

bipartition()
Bipartition a sample set
dclust()
Divisive clustering
plot(<dclust>)
Plot divisive clustering hierarchy
bipartiteMatch()
Bipartite graph matching

Composable Factorization Graphs

Build complex factorization pipelines with factor_net

factor_net()
Compile a factorization network
factor_input()
Create an input node for a factorization network
factor_config()
Global configuration for a factorization network
nmf_layer()
Create an NMF factorization layer
svd_layer()
Create an SVD/PCA factorization layer
factor_shared()
Shared factorization across multiple inputs (multi-modal)
factor_concat()
Concatenate H factors from branches (row-bind)
factor_add()
Element-wise H addition (skip/residual connection)
factor_condition()
Concatenate conditioning metadata to a layer's H
fit()
Fit a factorization network
W() H()
Per-factor configuration for factorization layers
cross_validate_graph()
Cross-validate a factorization network
predict(<factor_net_result>)
Project new data through a trained factor network
training_logger()
Create a training logger for factor network fitting
export_log()
Export training log to CSV
plot(<training_logger>)
Plot training log
as.data.frame(<training_logger>)
Convert training log to data.frame
classify_embedding()
Evaluate classification performance of factor embeddings
classify_logistic()
Logistic regression classifier for factor embeddings
classify_rf()
Random forest classifier for factor embeddings
`$`(<factor_net_result>)
Access layer results by name
print(<factor_net>)
Print a factor_net
print(<factor_net_cv>)
Print a factor_net_cv result
print(<factor_net_result>)
Print a factor_net_result
print(<fn_factor_config>)
Print an fn_factor_config
print(<fn_global_config>)
Print an fn_global_config
print(<fn_node>)
Print an fn_node
print(<fn_classifier_eval>)
Print a classifier evaluation result
summary(<factor_net_result>)
Summarize a factor_net_result
summary(<fn_classifier_eval>)
Summarize a classifier evaluation result
print(<training_logger>)
Print a training log

Simulation

Functions for generating synthetic data

simulateNMF()
Simulate an NMF dataset
simulateSwimmer()
Simulate Swimmer Dataset

StreamPress I/O

Streaming sparse matrix format (.spz)

st_add_transpose()
Add Transpose Section to an Existing StreamPress File
st_chunk_ranges()
Get Column Ranges for Each Chunk in a StreamPress File
st_filter_cols()
Slice Columns Matching Variable Metadata Filter
st_filter_rows()
Slice Rows Matching Observation Metadata Filter
st_free_gpu()
Free GPU-Resident Sparse Matrix
st_info()
Get metadata from a StreamPress file
st_map_chunks()
Apply a Function to Every Chunk in a StreamPress File
st_obs_indices()
Get Row Indices Matching Observation Metadata Filter
st_read()
Read a StreamPress file into a dgCMatrix
st_read_dense()
Read a Dense Matrix from StreamPress v3 Format
st_read_gpu()
Read StreamPress File Directly to GPU Memory
st_read_obs()
Read Observation (Row) Metadata from a StreamPress File
st_read_var()
Read Variable (Column) Metadata from a StreamPress File
st_slice()
Slice Rows and/or Columns from a StreamPress File
st_slice_cols()
Slice Columns from a StreamPress File
st_slice_rows()
Slice Rows from a StreamPress File
st_write()
Write a sparse matrix to a StreamPress file
st_write_dense()
Write a Dense Matrix to StreamPress v3 Format
st_write_list()
Write a List of Matrices as a Single StreamPress File
streampress
StreamPress I/O: Read, Write, and Inspect Compressed Matrices

GPU Support

GPU acceleration functions

gpu_available()
Check if GPU acceleration is available
gpu_info()
Get GPU device information
gpu-backend
GPU NMF Backend
print(<gpu_sparse_matrix>) dim(<gpu_sparse_matrix>) nrow(<gpu_sparse_matrix>) ncol(<gpu_sparse_matrix>)
Methods for gpu_sparse_matrix objects

Datasets

Built-in datasets for examples and benchmarks

aml
Acute Myelogenous Leukemia (AML) Dataset
digits
MNIST Digits Dataset
golub
Golub ALL-AML Dataset (Brunet et al. 2004)
hawaiibirds
Hawaii Bird Species Frequency Dataset
movielens
MovieLens Dataset
olivetti
Olivetti Faces Dataset
pbmc3k
PBMC 3k Single-Cell RNA-seq Dataset (StreamPress Compressed)

Package

RcppML RcppML-package
RcppML: Fast Non-Negative Matrix Factorization and Divisive Clustering