skdownscale.pointwise_models.GroupedRegressor¶
- class skdownscale.pointwise_models.GroupedRegressor(estimator, fit_grouper, predict_grouper, estimator_kwargs=None, fit_grouper_kwargs=None, predict_grouper_kwargs=None)[source]¶
Grouped Regressor
Wrapper supporting fitting seperate estimators distinct groups
- Parameters
- estimatorobject
Estimator object such as derived from BaseEstimator. This estimator will be fit to each group
- fit_grouperobject
Grouper object, such as pd.Grouper or PaddedDOYGrouper used to split data into groups during fitting.
- predict_grouperobject, func, str
Grouper object, such as pd.Grouper used to split data into groups during prediction.
- estimator_kwargsdict
Keyword arguments to pass onto the estimator’s contructor.
- fit_grouper_kwargsdict
Keyword arguments to pass onto the `fit_grouper`s contructor.
- predict_grouper_kwargsdict
Keyword arguments to pass onto the `predict_grouper`s contructor.
Methods
fit
(X, y, **fit_kwargs)Fit the grouped regressor
predict
(X)Predict estimator target for X
- __init__(estimator, fit_grouper, predict_grouper, estimator_kwargs=None, fit_grouper_kwargs=None, predict_grouper_kwargs=None)[source]¶
Methods
__init__
(estimator, fit_grouper, predict_grouper)fit
(X, y, **fit_kwargs)Fit the grouped regressor
predict
(X)Predict estimator target for X