Skip to content

Add BaggingClassifier and BaggingRegressor support - #742

Merged
desilinguist merged 6 commits into
mainfrom
614-add-bagging-estimators
Jun 20, 2023
Merged

Add BaggingClassifier and BaggingRegressor support#742
desilinguist merged 6 commits into
mainfrom
614-add-bagging-estimators

Conversation

@desilinguist

@desilinguist desilinguist commented Jun 20, 2023

Copy link
Copy Markdown
Collaborator
  • Fix: base estimators cannot be serialized
    • It turns out that there's a long standing bug in SKLL where using meta-estimators like AdaBoost* that use a base estimator are unable to be used with run_experiment since their base estimator prevents the model parameters dictionary from being serialized to disk. Added code that replaces the base estimator object with a string before serializing.
    • Existing tests did not cover this scenario since they used those meta-estimators via the API and not via a configuration file. Added new tests that covered this scenario.
  • Add support for BaggingClassifier and BaggingRegressor
    • Enable them to be used in SKLL.
    • Set default parameter grids for grid search.
  • Add documetnation for Bagging{Classifier,Regressor} use.
  • New tests for Bagging{Classifier,Regressor}

Easiest way to review is to try out the new learners (along with different estimator fixed parameter values) in the California and Titanic examples.

This PR closes #614.

- It turns out that there's a long standing bug in SKLL where
  using meta-estimators like AdaBoost* that use a base estimator
  are unable to be used with `run_experiment` since their base
  estimator prevents the model parameters dictionary from being
  serialized to disk. Added code that replaces the base estimator object
  with a string before serializing.
- Existing tests did not cover this scenario since they used those
  meta-estimators via the API and not via a configuration file. Added
  new tests that covered this scenario.
@codecov

codecov Bot commented Jun 20, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ce40d5b) 95.19% compared to head (0108e7b) 95.19%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #742   +/-   ##
=======================================
  Coverage   95.19%   95.19%           
=======================================
  Files          29       29           
  Lines        3535     3538    +3     
=======================================
+ Hits         3365     3368    +3     
  Misses        170      170           
Impacted Files Coverage Δ
skll/utils/constants.py 100.00% <ø> (ø)
skll/experiments/utils.py 93.54% <100.00%> (+0.15%) ⬆️
skll/learner/__init__.py 97.18% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Frost45 Frost45 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Testing it out locally!

Comment thread tests/test_classification.py Outdated
Comment thread tests/test_regression.py Outdated

@Frost45 Frost45 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested it out with Titanic! Everything works as expected 🎉

Co-authored-by: Sanjna Kashyap <20379363+Frost45@users.noreply.github.com>
@desilinguist
desilinguist merged commit 90251a2 into main Jun 20, 2023
@delete-merged-branch
delete-merged-branch Bot deleted the 614-add-bagging-estimators branch June 20, 2023 19:35
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.

Add BaggingClassifer and BaggingRegressor

2 participants