Python port of FNNLSa algorithm by Rasmus Bro. Directly taken from his MATLAB file exchange:
This translation requires NumPy.
Note that for FNNLS, the symmetric matrix FNNLSa(AtA, Atb)
. The NNLS implementation from scipy.optimize
uses nnls(A,b)
instead.
Running %timeit
magic with IPython notebook with a toy problem (see ipynb file in this repository):
scipy.optimize NNLS
41 ms ± 358 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
FNNLSa
9.73 ms ± 51.7 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
For a transformation matrix (600 x 1000)