OnlineNMF.jl (Julia API)

Non-negative Matrix Factorization (NMF)

OnlineNMF.nmfMethod
nmf(;input::AbstractString="", outdir::Union{Nothing,AbstractString}=nothing, alpha::Number=1, beta::Number=2, graphv::Number=0, l1u::Number=eps(Float32), l1v::Number=eps(Float32), l2u::Number=eps(Float32), l2v::Number=eps(Float32), dim::Number=3, numepoch::Number=5, chunksize::Number=1, algorithm::AbstractString="frobenius", lower::Number=0, upper::Number=1.0f+38, initU::Union{Nothing,AbstractString}=nothing, initV::Union{Nothing,AbstractString}=nothing, initL::Union{Nothing,AbstractString}=nothing, logdir::Union{Nothing,AbstractString}=nothing)

Non-negative Matrix Factorization (NMF).

Input Arguments

  • input : Julia Binary file generated by OnlinePCA.csv2bin function.
  • outdir : The directory user want to save the result.
  • alpha : The parameter of Alpha-divergence.
  • beta : The parameter of Beta-divergence.
  • graphv : Graph regularization parameter for the factor matrix V.
  • l1u : L1-regularization parameter for the factor matrix U.
  • l1v : L1-regularization parameter for the factor matrix V.
  • l2u : L2-regularization parameter for the factor matrix U.
  • l2v : L2-regularization parameter for the factor matrix V.
  • dim : The number of dimension of NMF.
  • numepoch : The number of epochs.
  • `chunksize: The number of rows reading at once (e.g. 5000).
  • algorithm: Update Algorithm. frobenius, kl, is, pearson, hellinger, neyman, alpha, and beta are available.
  • lower : Stopping Criteria (When the relative change of error is below this value, the calculation is terminated).
  • upper : Stopping Criteria (When the relative change of error is above this value, the calculation is terminated).
  • initU : The CSV file saving the initial values of factor matrix U.
  • initV : The CSV file saving the initial values of factor matrix V.
  • initL : The CSV file saving the initial values of graph laplacian L.
  • logdir : The directory where intermediate files are saved in every epoch.

Output Arguments

  • U : Factor matrix (No. rows of the data matrix × dim)
  • V : Factor matrix (No. columns of the data matrix × dim)
  • stop : Whether the calculation is converged
source

Discretized Non-negative Matrix Factorization (DNMF)

OnlineNMF.dnmfMethod
dnmf(;input::AbstractString="", outdir::Union{Nothing,AbstractString}=nothing, beta::Number=2, binu::Number=eps(Float32), binv::Number=eps(Float32), teru::Number=eps(Float32), terv::Number=eps(Float32), graphv::Number=0, l1u::Number=eps(Float32), l1v::Number=eps(Float32), l2u::Number=eps(Float32), l2v::Number=eps(Float32), dim::Number=3, numepoch::Number=5, chunksize::Number=1, lower::Number=0, upper::Number=1.0f+38, initU::Union{Nothing,AbstractString}=nothing, initV::Union{Nothing,AbstractString}=nothing, initL::Union{Nothing,AbstractString}=nothing, logdir::Union{Nothing,AbstractString}=nothing)

Discretized Non-negative Matrix Factorization (DNMF).

Input Arguments

  • input : Julia Binary file generated by OnlinePCA.mm2bin function.
  • outdir : The directory user want to save the result.
  • beta : The parameter of Beta-divergence.
  • binu : Binary {0,1} regularization parameter for the factor matrix U.
  • binv : Binary {0,1} regularization parameter for the factor matrix V.
  • teru : Ternary {0,1,2} regularization parameter for the factor matrix U.
  • terv : Ternary {0,1,2} regularization parameter for the factor matrix V.
  • graphv : Graph regularization parameter for the factor matrix V.
  • l1u : L1-regularization parameter for the factor matrix U.
  • l1v : L1-regularization parameter for the factor matrix V.
  • l2u : L2-regularization parameter for the factor matrix U.
  • l2v : L2-regularization parameter for the factor matrix V.
  • dim : The number of dimension of NMF.
  • numepoch : The number of epochs.
  • `chunksize: The number of rows reading at once (e.g. 5000).
  • lower : Stopping Criteria (When the relative change of error is below this value, the calculation is terminated)
  • upper : Stopping Criteria (When the relative change of error is above this value, the calculation is terminated)
  • initU : The CSV file saving the initial values of factor matrix U.
  • initV : The CSV file saving the initial values of factor matrix V.
  • initL : The CSV file saving the initial values of graph laplacian L.
  • logdir : The directory where intermediate files are saved, in every epoch.

Output Arguments

  • U : Factor matrix (No. rows of the data matrix × dim)
  • V : Factor matrix (No. columns of the data matrix × dim)
  • stop : Whether the calculation is converged
source

Sparse Non-negative Matrix Factorization (SNMF)

OnlineNMF.sparse_nmfMethod
sparse_nmf(;input::AbstractString="", outdir::Union{Nothing,AbstractString}=nothing, alpha::Number=1, beta::Number=2, graphv::Number=0, l1u::Number=eps(Float32), l1v::Number=eps(Float32), l2u::Number=eps(Float32), l2v::Number=eps(Float32), dim::Number=3, numepoch::Number=5, chunksize::Number=1, algorithm::AbstractString="frobenius", lower::Number=0, upper::Number=1.0f+38, initU::Union{Nothing,AbstractString}=nothing, initV::Union{Nothing,AbstractString}=nothing, initL::Union{Nothing,AbstractString}=nothing, logdir::Union{Nothing,AbstractString}=nothing)

Sparse Non-negative Matrix Factorization (SNMF).

Input Arguments

  • input : Julia Binary file generated by OnlinePCA.mm2bin function.
  • outdir : The directory user want to save the result.
  • alpha : The parameter of Alpha-divergence.
  • beta : The parameter of Beta-divergence.
  • graphv : Graph regularization parameter for the factor matrix V.
  • l1u : L1-regularization parameter for the factor matrix U.
  • l1v : L1-regularization parameter for the factor matrix V.
  • l2u : L2-regularization parameter for the factor matrix U.
  • l2v : L2-regularization parameter for the factor matrix V.
  • dim : The number of dimension of NMF.
  • numepoch : The number of epochs.
  • `chunksize: The number of rows reading at once (e.g. 5000).
  • algorithm: Update Algorithm. frobenius, kl, is, pearson, hellinger, neyman, alpha, and beta are available.
  • lower : Stopping Criteria (When the relative change of error is below this value, the calculation is terminated).
  • upper : Stopping Criteria (When the relative change of error is above this value, the calculation is terminated).
  • initU : The CSV file saving the initial values of factor matrix U.
  • initV : The CSV file saving the initial values of factor matrix V.
  • initL : The CSV file saving the initial values of graph laplacian L.
  • logdir : The directory where intermediate files are saved in every epoch.

Output Arguments

  • U : Factor matrix (No. rows of the data matrix × dim)
  • V : Factor matrix (No. columns of the data matrix × dim)
  • stop : Whether the calculation is converged
source

Sparse Discretized Non-negative Matrix Factorization (SDNMF)

OnlineNMF.sparse_dnmfMethod
sparse_dnmf(;input::AbstractString="", outdir::Union{Nothing,AbstractString}=nothing, beta::Number=2, binu::Number=eps(Float32), binv::Number=eps(Float32), teru::Number=eps(Float32), terv::Number=eps(Float32), graphv::Number=0, l1u::Number=eps(Float32), l1v::Number=eps(Float32), l2u::Number=eps(Float32), l2v::Number=eps(Float32), dim::Number=3, numepoch::Number=5, chunksize::Number=1, lower::Number=0, upper::Number=1.0f+38, initU::Union{Nothing,AbstractString}=nothing, initV::Union{Nothing,AbstractString}=nothing, initL::Union{Nothing,AbstractString}=nothing, logdir::Union{Nothing,AbstractString}=nothing)

Sparse Discretized Non-negative Matrix Factorization (SDNMF).

Input Arguments

  • input : Julia Binary file generated by OnlinePCA.mm2bin function.
  • outdir : The directory user want to save the result.
  • beta : The parameter of Beta-divergence.
  • binu : Binary {0,1} regularization parameter for the factor matrix U.
  • binv : Binary {0,1} regularization parameter for the factor matrix V.
  • teru : Ternary {0,1,2} regularization parameter for the factor matrix U.
  • terv : Ternary {0,1,2} regularization parameter for the factor matrix V.
  • graphv : Graph regularization parameter for the factor matrix V.
  • l1u : L1-regularization parameter for the factor matrix U.
  • l1v : L1-regularization parameter for the factor matrix V.
  • l2u : L2-regularization parameter for the factor matrix U.
  • l2v : L2-regularization parameter for the factor matrix V.
  • dim : The number of dimension of NMF.
  • numepoch : The number of epochs.
  • `chunksize: The number of rows reading at once (e.g. 5000).
  • lower : Stopping Criteria (When the relative change of error is below this value, the calculation is terminated)
  • upper : Stopping Criteria (When the relative change of error is above this value, the calculation is terminated)
  • initU : The CSV file saving the initial values of factor matrix U.
  • initV : The CSV file saving the initial values of factor matrix V.
  • initL : The CSV file saving the initial values of graph laplacian L.
  • logdir : The directory where intermediate files are saved, in every epoch.

Output Arguments

  • U : Factor matrix (No. rows of the data matrix × dim)
  • V : Factor matrix (No. columns of the data matrix × dim)
  • stop : Whether the calculation is converged
source

BinCOO Non-negative Matrix Factorization (BinCOONMF)

OnlineNMF.bincoo_nmfMethod
bincoo_nmf(;input::AbstractString="", outdir::Union{Nothing,AbstractString}=nothing, alpha::Number=1, beta::Number=2, graphv::Number=0, l1u::Number=eps(Float32), l1v::Number=eps(Float32), l2u::Number=eps(Float32), l2v::Number=eps(Float32), dim::Number=3, numepoch::Number=5, chunksize::Number=1, algorithm::AbstractString="frobenius", lower::Number=0, upper::Number=1.0f+38, initU::Union{Nothing,AbstractString}=nothing, initV::Union{Nothing,AbstractString}=nothing, initL::Union{Nothing,AbstractString}=nothing, logdir::Union{Nothing,AbstractString}=nothing)

Sparse Non-negative Matrix Factorization (SNMF).

Input Arguments

  • input : Julia Binary file generated by OnlinePCA.mm2bin function.
  • outdir : The directory user want to save the result.
  • alpha : The parameter of Alpha-divergence.
  • beta : The parameter of Beta-divergence.
  • graphv : Graph regularization parameter for the factor matrix V.
  • l1u : L1-regularization parameter for the factor matrix U.
  • l1v : L1-regularization parameter for the factor matrix V.
  • l2u : L2-regularization parameter for the factor matrix U.
  • l2v : L2-regularization parameter for the factor matrix V.
  • dim : The number of dimension of NMF.
  • numepoch : The number of epochs.
  • `chunksize: The number of rows reading at once (e.g. 5000).
  • algorithm: Update Algorithm. frobenius, kl, is, pearson, hellinger, neyman, alpha, and beta are available.
  • lower : Stopping Criteria (When the relative change of error is below this value, the calculation is terminated).
  • upper : Stopping Criteria (When the relative change of error is above this value, the calculation is terminated).
  • initU : The CSV file saving the initial values of factor matrix U.
  • initV : The CSV file saving the initial values of factor matrix V.
  • initL : The CSV file saving the initial values of graph laplacian L.
  • logdir : The directory where intermediate files are saved in every epoch.

Output Arguments

  • U : Factor matrix (No. rows of the data matrix × dim)
  • V : Factor matrix (No. columns of the data matrix × dim)
  • stop : Whether the calculation is converged
source

BinCOO Discretized Non-negative Matrix Factorization (BinCOODNMF)

OnlineNMF.bincoo_dnmfMethod
bincoo_dnmf(;input::AbstractString="", outdir::Union{Nothing,AbstractString}=nothing, beta::Number=2, binu::Number=eps(Float32), binv::Number=eps(Float32), teru::Number=eps(Float32), terv::Number=eps(Float32), graphv::Number=0, l1u::Number=eps(Float32), l1v::Number=eps(Float32), l2u::Number=eps(Float32), l2v::Number=eps(Float32), dim::Number=3, numepoch::Number=5, chunksize::Number=1, lower::Number=0, upper::Number=1.0f+38, initU::Union{Nothing,AbstractString}=nothing, initV::Union{Nothing,AbstractString}=nothing, initL::Union{Nothing,AbstractString}=nothing, logdir::Union{Nothing,AbstractString}=nothing)

Sparse Discretized Non-negative Matrix Factorization (SDNMF).

Input Arguments

  • input : Julia Binary file generated by OnlinePCA.mm2bin function.
  • outdir : The directory user want to save the result.
  • beta : The parameter of Beta-divergence.
  • binu : Binary {0,1} regularization parameter for the factor matrix U.
  • binv : Binary {0,1} regularization parameter for the factor matrix V.
  • teru : Ternary {0,1,2} regularization parameter for the factor matrix U.
  • terv : Ternary {0,1,2} regularization parameter for the factor matrix V.
  • graphv : Graph regularization parameter for the factor matrix V.
  • l1u : L1-regularization parameter for the factor matrix U.
  • l1v : L1-regularization parameter for the factor matrix V.
  • l2u : L2-regularization parameter for the factor matrix U.
  • l2v : L2-regularization parameter for the factor matrix V.
  • dim : The number of dimension of NMF.
  • numepoch : The number of epochs.
  • `chunksize: The number of rows reading at once (e.g. 5000).
  • lower : Stopping Criteria (When the relative change of error is below this value, the calculation is terminated)
  • upper : Stopping Criteria (When the relative change of error is above this value, the calculation is terminated)
  • initU : The CSV file saving the initial values of factor matrix U.
  • initV : The CSV file saving the initial values of factor matrix V.
  • initL : The CSV file saving the initial values of graph laplacian L.
  • logdir : The directory where intermediate files are saved, in every epoch.

Output Arguments

  • U : Factor matrix (No. rows of the data matrix × dim)
  • V : Factor matrix (No. columns of the data matrix × dim)
  • stop : Whether the calculation is converged
source

Graph Laplacian (L = D - A, where D is a degree matrix and A is an adjacent matrix).

OnlineNMF.graph_laplacianFunction
graph_laplacian(A::AbstractArray, norm::Bool=true)

Graph Laplacian (L = D - A, where D is a degree matrix and A is an adjacent matrix).

Input Arguments

  • A : A symmetric numerical matrix.
  • norm : Whether to normalize the graph Laplacian or not.

Output Arguments

  • Graph Laplacian Matrix (No. rows/columns of A × No. rows/columns of A)
source