Factorizations

class untwist.factorizations.NMF(rank, update_func='kl', iterations=100, threshold=None, W_norm=2, H_norm=0, update_W=True, update_H=True, return_divergence=False, beta=0)[source]

General NMF class, including euclidean, kl and beta-divergence implementations. For supervised NMF, typically set update_W to false in the constructor and provide a W0 to the process method

beta_updates(V, W, H)[source]

Optimize B-divergence

divergence(V, W, H)[source]

Compute divergence between reconstruction and original

euc_updates(V, W, H)[source]

Optimize Euclidean distance

is_updates(V, W, H)[source]

Optimize Itakura-Saito divergence (using B-divergence)

kl_updates(V, W, H)[source]

Optimize Kullback-Leibler divergence

normalize(X, p, axis)[source]

Normalize marix (W or H)

process(V, W0=None, H0=None)[source]

Initialize and compute multiplicative updates iterations

class untwist.factorizations.RPCA(iterations=100, threshold=None, l=1, mu=1.25, rho=1.5)[source]

Robust PCA, Inexact ALM method Based on http://perception.csl.illinois.edu/matrix-rank/sample_code.html

process(X)[source]