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

[ENH] fit_compute_func API #22

Merged
merged 17 commits into from
Jan 12, 2020
Merged

[ENH] fit_compute_func API #22

merged 17 commits into from
Jan 12, 2020

Conversation

alegonz
Copy link
Owner

@alegonz alegonz commented Jan 12, 2020

  • Add new fit_compute_func to Step.__call__ that allows to specify custom behavior at fit time.
  • Add example of stacked classifiers that follow the standard protocol.
  • Use "auto" to specify automatic detection of compute_func and fit_compute_func, reserve None to disable the fit_compute_func.
  • Add capability of specifying extra attributes to classes created with make_step via a attr_dict argument. This is useful to add custom fit_predict/fit_transform methods.

The motivation follows the rationale in Issue #16:

  1. Make custom fitting protocols, such as the common stacking protocol that uses out-of-fold predictions in the first level, possible. (The current stacked classifier example is a naive example that does not use OOF predictions and thus the second level classifier is prone to prefer an overfitted classifier from the first level).
  2. Allow the use of transductive estimators (e.g. sklearn.manifold.TSNE, sklearn.cluster.AgglomerativeClustering).
  3. Leverage estimators that implement a fit_transform more efficient than calling fit and transform separately.

@codecov-io
Copy link

codecov-io commented Jan 12, 2020

Codecov Report

Merging #22 into master will increase coverage by 0.03%.
The diff coverage is 98.76%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #22      +/-   ##
=========================================
+ Coverage   97.87%   97.9%   +0.03%     
=========================================
  Files          13      13              
  Lines         705     764      +59     
  Branches      130     142      +12     
=========================================
+ Hits          690     748      +58     
  Misses         11      11              
- Partials        4       5       +1
Impacted Files Coverage Δ
baikal/steps/expression.py 100% <ø> (ø) ⬆️
baikal/_core/step.py 100% <100%> (ø) ⬆️
baikal/steps/factory.py 100% <100%> (ø) ⬆️
baikal/_core/model.py 99.59% <96.29%> (-0.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b1efd9...1704881. Read the comment docs.

@alegonz alegonz merged commit 186c65b into master Jan 12, 2020
@alegonz alegonz deleted the feature/fit-compute-api branch January 12, 2020 09:50
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