rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.82k stars 853 forks source link

Use scipy's decompositions in PCA. #1080

Closed fkdosilovic closed 3 months ago

fkdosilovic commented 5 months ago

Description

Use scipy's decompositions in PCA.

Related issues or pull requests

Fixes https://github.com/rasbt/mlxtend/issues/1078

Pull Request Checklist

fkdosilovic commented 5 months ago

Benchmark code and results:

Results on AMD Ryzen 5 5625U with 6 cores (12 threads):

Timings are reported in seconds. Each experiment was run 10 times.

method shape avg std min max
numpy.linalg.svd (10, 10) 0.00 0.00 0.00 0.00
(100, 100) 0.00 0.00 0.00 0.01
(500, 500) 0.05 0.01 0.04 0.07
(1000, 1000) 0.23 0.02 0.21 0.27
(5000, 1000) 4.07 0.15 3.90 4.39
scipy.linalg.svd (10, 10) 0.00 0.00 0.00 0.00
(100, 100) 0.00 0.00 0.00 0.01
(500, 500) 0.04 0.00 0.04 0.05
(1000, 1000) 0.20 0.01 0.19 0.23
(5000, 1000) 3.92 0.14 3.80 4.25

scipy v1.11.4 and numpy v1.26.3

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.32%. Comparing base (8592cc7) to head (f61c01c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1080 +/- ## ========================================== - Coverage 78.34% 78.32% -0.02% ========================================== Files 196 196 Lines 11157 11158 +1 Branches 1404 1404 ========================================== - Hits 8741 8740 -1 - Misses 2199 2200 +1 - Partials 217 218 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.