Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support fit_params in stacking #18028

Copy link
Copy link
Closed
@a-wozniakowski

Description

@a-wozniakowski
Issue body actions

Currently, there is no support for **fit_params in the fit method of _BaseStacking:

def fit(self, X, y, sample_weight=None):

As introduced in issue #15953 for _MultiOutputEstimator, it seems natural to extend the utility to stacking. A proposed implementation in the base stacking class is as follows:

from ..utils.validation import _check_fit_params

def fit(self, X, y, sample_weight=None, **fit_params):
    # Right before predictions = Parallel...
    if fit_params:
        fit_params = _check_fit_params(X, fit_params)
    else:
        fit_params = (dict(sample_weight=sample_weight)
                      if sample_weight is not None
                      else None)
    # Then, utilize fit_params in the parallelized cross_val_predict

Subsequently, alter the fit methods for StackingClassifier and StackingRegressor such that they support **fit_params. If this is favorable, then I can write an implementation and start the pull request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.