Benchmark test for method options of ml-pca package
covarianceMatrix
is the fastest.
Tested in RunKit + npm
method | hz |
---|---|
SVD |
3099 |
covarianceMatrix |
6405 |
NIPALS |
220 |
NIPALS, {nCompNIPALS: 4} |
129 |
[0.9246187232017269, 0.05306648311706793, 0.01710260980792975, 0.005212183873275375]
[0.9246187232017269, 0.05306648311706785, 0.017102609807929704, 0.005212183873275558]
[0.9457223216899879, 0.05427767831001216]
[0.9246187232017233, 0.053066483117027, 0.017102609807958833, 0.005212183873290879]
- The NIPALS Algorithm
The NIPALS Algorithm gives more numerically accurate results when compared with the SVD of the covariance matrix, but is slower to calculate.