GAA-UAM / scikit-fda

Functional Data Analysis Python package
https://fda.readthedocs.io
BSD 3-Clause "New" or "Revised" License
309 stars 58 forks source link

Functional PLS for dimensionality reduction and regression #548

Closed Ddelval closed 1 year ago

Ddelval commented 1 year ago

This implementation of FPLS accepts multivariate or functional data. Either X or Y can be multivariate or functional. Regularization in functional blocks is also implemented. Regarding the regression functionality, PLSRegression also accepts functional or multivariate data as the regressor or the response. However, the functional response of the PLS regressor cannot be regularized.

codecov[bot] commented 1 year ago

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (4207c4d) 86.27% compared to head (e0c4ab5) 86.67%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #548 +/- ## =========================================== + Coverage 86.27% 86.67% +0.40% =========================================== Files 149 153 +4 Lines 11912 12390 +478 =========================================== + Hits 10277 10739 +462 - Misses 1635 1651 +16 ``` | [Files](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM) | Coverage Δ | | |---|---|---| | [skfda/ml/regression/\_fpls\_regression.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvbWwvcmVncmVzc2lvbi9fZnBsc19yZWdyZXNzaW9uLnB5) | `100.00% <100.00%> (ø)` | | | [skfda/tests/test\_fpls.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvdGVzdHMvdGVzdF9mcGxzLnB5) | `100.00% <100.00%> (ø)` | | | [skfda/tests/test\_fpls\_regression.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvdGVzdHMvdGVzdF9mcGxzX3JlZ3Jlc3Npb24ucHk=) | `100.00% <100.00%> (ø)` | | | [skfda/preprocessing/dim\_reduction/\_fpls.py](https://app.codecov.io/gh/GAA-UAM/scikit-fda/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvcHJlcHJvY2Vzc2luZy9kaW1fcmVkdWN0aW9uL19mcGxzLnB5) | `93.54% <93.54%> (ø)` | |

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

vnmabus commented 1 year ago

The requested changes are minor. @Ddelval, if you do not have time/will for doing them I can finish this PR myself and merge it. However, I would really appreciate if you could spare a few minutes to answer my questions, as you are way more familiar with the algorithm.

Ddelval commented 1 year ago

Hi @vnmabus, I believe I should have some time towards the end of next week. I already had a look at your comments a while ago, but I didn't have the time to reply. I haven't had much time lately, but I'm hoping that'll improve a bit this week.

Ddelval commented 1 year ago

Hi @vnmabus. Sorry for the delay. It seems like I tend to overestimate the amount of free time I have 🙃. Anyway, I replied to most of your comments. Additionally, I changed the behavior when not all requested components can be extracted. This will happen, for example, if the range of the data matrices is less than n_components. Right now, as many components as possible are returned., and a warning is raised when this happens.

Ddelval commented 1 year ago

Hi @vnmabus, I'm getting an error in test_regression in some test runs. Could you have a look at it? I had a look, and I couldn't find any recent changes that could make the assert fail.