mlpack_nmf(1)

πŸ’– mlpack_nmf β€” non-negative matrix factorization πŸ’–

okay so bestie, this is mlpack_nmf(1), it lives in the User Commands section and it is literally about to change your whole matrix life, no cap ✨


✨ NAME ✨

mlpack_nmf β€” non-negative matrix factorization πŸ¦‹


🌸 SYNOPSIS 🌸

mlpack_nmf -i unknown -r int [-q unknown] [-p unknown] [-m int] [-e double] [-s int] [-u string] [-V bool] [-H unknown] [-W unknown] [-h -v]

πŸ’… DESCRIPTION πŸ’…

so basically, this program performs non-negative matrix factorization on whatever dataset you hand it, and then it stores the resulting decomposed matrices in the files you specify. 🫢

for an input dataset V, NMF decomposes V into two matrices W and H such that

V = W * H

where all elements in W and H are non-negative. periodt, that's the whole vibe.

if V is of size (n x m), then W will be of size (n x r) and H will be of size (r x m), where r is the rank of the factorization β€” and you specify that with the --rank (-r) parameter. πŸ‘‘

optionally, the desired update rules for each NMF iteration can be chosen from the following list:

  • multdist: multiplicative distance-based update rules (Lee and Seung 1999)
  • multdiv: multiplicative divergence-based update rules (Lee and Seung 1999)
  • als: alternating least squares update rules (Paatero and Tapper 1994)

the maximum number of iterations is specified with --max_iterations (-m), and the minimum residue required for algorithm termination is specified with the --min_residue (-e) parameter. πŸ“‰

for example, to run NMF on the input matrix V.csv using the multdist update rules with a rank-10 decomposition and storing the decomposed matrices into W.csv and H.csv, the following command could be used:

$ mlpack_nmf --input_file V.csv --w_file W.csv --h_file H.csv --rank 10 --update_rules multdist

iconic. ate. πŸ’…


πŸŽ€ REQUIRED INPUT OPTIONS πŸŽ€

these ones are not optional bestie, you genuinely cannot skip them:

  • --input_file (-i) [unknown] β€” the input dataset to perform NMF on. yes queen, give it your data.
  • --rank (-r) [int] β€” the rank of the factorization. 🌟

⭐ OPTIONAL INPUT OPTIONS ⭐

extra little knobs, take them or leave them:

  • --help (-h) [bool] β€” default help info. πŸ†˜
  • --info [string] β€” print help on a specific option. default value is ''.
  • --initial_h_file (-q) [unknown] β€” initial H matrix.
  • --initial_w_file (-p) [unknown] β€” initial W matrix.
  • --max_iterations (-m) [int] β€” number of iterations before NMF terminates (0 runs until convergence). default value 10000. ⏳
  • --min_residue (-e) [double] β€” the minimum root mean square residue allowed for each iteration, below which the program terminates. default value 1e-05.
  • --seed (-s) [int] β€” random seed. if 0, std::time(NULL) is used. default value 0. 🎲
  • --update_rules (-u) [string] β€” update rules for each iteration; ( multdist | multdiv | als ). default value 'multdist'.
  • --verbose (-v) [bool] β€” display informational messages and the full list of parameters and timers at the end of execution. πŸ“’
  • --version (-V) [bool] β€” display the version of mlpack. 🌈

πŸ”₯ OPTIONAL OUTPUT OPTIONS πŸ”₯

where your beautiful results go:

  • --h_file (-H) [unknown] β€” matrix to save the calculated H to. πŸ’œ
  • --w_file (-W) [unknown] β€” matrix to save the calculated W to. πŸ’–

🌈 ADDITIONAL INFORMATION 🌈

for further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack. πŸ“š


ngl bestie, the non-negativity thing is the whole point β€” don't come at it with negative numbers and then act surprised. πŸ™ˆ

and that's the whole page, mwah 🧚 this was mlpack-4.8.0, dated 22 June 2026 β€” mlpack_nmf(1), signing off. slay responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from