GAA-UAM / scikit-fda

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

Issue/classifier classes/centroid #492

Closed m5signorini closed 1 year ago

m5signorini commented 1 year ago

Solution for nearest centroid and DTM for issue #480. Passes locally the test_classifier_classes. I think it is easier to modify the test script after updating all classifiers, while I locally check that the changes pass the test. Adding the classifier to the test script during each pull request may result in merge conflicts I guess.

codecov[bot] commented 1 year ago

Codecov Report

Base: 85.35% // Head: 85.35% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (ad415aa) compared to base (3589f88). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #492 +/- ## ======================================== Coverage 85.35% 85.35% ======================================== Files 139 139 Lines 11060 11061 +1 ======================================== + Hits 9440 9441 +1 Misses 1620 1620 ``` | [Impacted Files](https://codecov.io/gh/GAA-UAM/scikit-fda/pull/492?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM) | Coverage Δ | | |---|---|---| | [skfda/ml/classification/\_centroid\_classifiers.py](https://codecov.io/gh/GAA-UAM/scikit-fda/pull/492/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM#diff-c2tmZGEvbWwvY2xhc3NpZmljYXRpb24vX2NlbnRyb2lkX2NsYXNzaWZpZXJzLnB5) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GAA-UAM)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

m5signorini commented 1 year ago

It will probably be a good idea to parametrize the output of the class, that is to add a Target type var to work with NDArrayInt and NDArrayStr. I include the change in this pull request.

m5signorini commented 1 year ago

I noticed every other classifier has the target restricted to NDArrayInt, should I update them in a similar way, using a TypeVar bound to Union[NDArrayInt,NDArrayStr], ? (In their respective pull requests)