Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add new scorer: MaNoScorer #289

Merged
merged 12 commits into from
Feb 21, 2025
Merged

Conversation

ambroiseodt
Copy link
Contributor

@ambroiseodt ambroiseodt commented Jan 9, 2025

Implementation of MaNo as an unsupervised realistic scorer.

This should answer #288.

  • Update README.md
  • Update docs/source/all.rst
  • Update skada/metrics.py
  • Update skada/tests/test_scorer.py
  • Update skada/deep/tests/test_deep_scorer.py

@ambroiseodt
Copy link
Contributor Author

ambroiseodt commented Jan 9, 2025

At the time of writing, I haven't changed the skada/deep/tests/test_deep_scorer.py yet and there are already failing test when it comes to torch and to the deep methods. It seems that the error is super' object has no attribute '__sklearn_tags__, which seems to be related to an update of sklearn (see StackOverflow. Maybe you already have you ever seen this error @tgnassou?

I will investigate that while also adding the MaNoScorer test for the deep methods.

@antoinecollas
Copy link
Collaborator

antoinecollas commented Jan 9, 2025

Yes, deep learning tests are failling because skorch v1.0.0 is not compatible with sklearn 1.6.0. They fixed skorch and we are waiting for a new release (see skorch-dev/skorch#1085).

In the meantine, you can test your PR with skorch 1.0.0 and sklearn 1.5.2.

@ambroiseodt
Copy link
Contributor Author

Thanks @antoinecollas, yes I am using skorch 1.0.0 and sklearn 1.5.2 in local, I will push the test_deep_scorers once it works locally for me

@ambroiseodt
Copy link
Contributor Author

Thanks @antoinecollas, yes I am using skorch 1.0.0 and sklearn 1.5.2 in local, I will push the test_deep_scorers once it works locally for me

@antoinecollas It seems that the skorch issue has been resolved :)

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.92%. Comparing base (485752e) to head (93879f4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #289      +/-   ##
==========================================
- Coverage   97.07%   96.92%   -0.15%     
==========================================
  Files          63       63              
  Lines        6559     6671     +112     
==========================================
+ Hits         6367     6466      +99     
- Misses        192      205      +13     

# Test softmax normalization
scorer = MaNoScorer(threshold=-1)
score_mean = scorer._score(estimator, X, y, sample_domain=sample_domain)
assert isinstance(score_mean, float), "score_mean is not a float"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't check if it is the right normalization which is considered no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood, will do

MaNoScorer(),
],
)
def test_dev_exception_layer_name(scorer, da_dataset):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To what? it was the name already given

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understood, will do

@tgnassou tgnassou merged commit 14f20fe into scikit-adaptation:main Feb 21, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants