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

Adaboost: Remove deprecated argument 'algorithm' #6910

Merged
merged 3 commits into from
Oct 25, 2024

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Oct 9, 2024

Issue

In Sklearn 1.6, the only acceptable value for AdaBoost's argument algorithmisSAMME`. In 1.8, the argument will be removed. (scikit-learn/scikit-learn#29997)

Description of changes
  • I removed the argument. This doesn't break any tests, so it apparently didn't have any effect (or we didn't test it properly). Any potential changes are however unavoidable because the current algorithm is removed from SkLearn (for the reasons, see RFC deprecate the SAMME.R algorithm in AdaBoostClassifier scikit-learn/scikit-learn#26784).
  • I removed the setting from the widget. I haven't provided any migration, not even showing a warning because the user would have no way to disable the warning. Besides, it probably doesn't matter.
  • Some tests depend on random seed. I change one of them to 4 so that results in scikit-learn=1.6.dev are the same as in earlier version(s).
Includes
  • Code changes
  • Tests
  • Documentation

@janezd janezd marked this pull request as draft October 10, 2024 12:52
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.41%. Comparing base (9497b39) to head (27a6c61).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6910      +/-   ##
==========================================
+ Coverage   88.40%   88.41%   +0.01%     
==========================================
  Files         326      326              
  Lines       71971    71974       +3     
==========================================
+ Hits        63624    63636      +12     
+ Misses       8347     8338       -9     

@janezd janezd force-pushed the adaboost-remove-samme branch 2 times, most recently from ae27304 to aa5b946 Compare October 10, 2024 16:19
@janezd janezd marked this pull request as ready for review October 10, 2024 16:26
@janezd janezd changed the title Adaboost: Remove deprecate argument 'algorithm' Adaboost: Remove deprecated argument 'algorithm' Oct 11, 2024
@@ -33,7 +33,7 @@ def test_adaboost(self):
self.assertLess(ca, 0.99)

def test_adaboost_estimator(self):
np.random.seed(0)
np.random.seed(4)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If random seed is 0, the result today is not the same as it was the last week. I discovered the 4 seems OK.

Scikit and pandas are moving targets. :(

Copy link
Contributor

@VesnaT VesnaT left a comment

Choose a reason for hiding this comment

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

With the a new version of scikit-learn a default value of unsettable (within Orange) parameter will change (algorithm).

Should we set the algorithm parameter to SAMME to assure the same behaviour as when the scikit 1.6 is released?

@@ -46,36 +44,36 @@ class Error(OWBaseLearner.Error):

def add_main_layout(self):
# this is part of init, pylint: disable=attribute-defined-outside-init
box = gui.widgetBox(self.controlArea, "Parameters")
grid = QFormLayout()
box = gui.widgetBox(self.controlArea, box=True, orientation=grid)
Copy link
Contributor

Choose a reason for hiding this comment

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

box variable is unused.

@janezd
Copy link
Contributor Author

janezd commented Oct 15, 2024

@VesnaT I put the algorithm argument back, with the default value of SAMME. As I understand, our wrapper for scikit learners will skip it when scikit-learn will no longer accept it (in version 1.8).

<rant>In the meantime, we're back in red because scikit developers decided it would be a terribly good idea to change the behaviour of AUC (scikit-learn/scikit-learn#27412). But this is something for the next PR...

Why do we depend on unstable packages like pandas, sklearn and scipy? No better alternatives? Shame, really.

Sorry, I'm pissed. I thought I'd be doing something useful today, not hunting another change in sklearn.</rant>

@VesnaT VesnaT merged commit e42b9b1 into biolab:master Oct 25, 2024
28 of 30 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.

2 participants