Conversation
|
Also worth considering others who have done the binding at least for POC (pyarma doesn't seem to have recent updates) PyArmadillo: linear algebra library for Python https://pyarma.sourceforge.io/docs.html#svd |
|
Another alternative is to use algos that are slight approximations and/ir truncated to top N values (where you set N large enough for it not to practically bind) For example randomized_svd https://scikit-learn.org/stable/modules/generated/sklearn.utils.extmath.randomized_svd.html randomized_svd — scikit-learn 1.7.1 documentation |
|
Paper reference on an alt algo https://arxiv.org/pdf/1704.05528 |
|
Cvopt inspiration. Nuclear norm approximation — CVXOPT https://cvxopt.org/applications/nucnrm/index.html |
More general to just use TruncatedSVD — scikit-learn 1.7.1 documentation https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.TruncatedSVD.html |
|
Note R version uses eigen. One option is to pybind (instead of R bind) everything already there directly https://github.com/susanathey/MCPanel/blob/master/src/mcnnm_R.cpp |
Set up SVD method comparison
scipy seems slightly faster than numpy
mlpack does not support an option that outputs the singular values in the python binding
Equivalent would be the raw C++
arma::svd(U, s, V, A)
but does not seem to have a python API equivalent (i think)
https://github.com/mlpack/mlpack/blob/master/src/mlpack/methods/cf/svd_wrapper.hpp