-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
189 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Quantile regression forecaster using a random forest model.""" | ||
|
||
from quantile_forest import RandomForestQuantileRegressor | ||
|
||
from probafcst.models.regression import QuantileRegressionForecaster | ||
|
||
|
||
class RandomForestQuantileForecaster(QuantileRegressionForecaster): | ||
"""Quantile regression forecaster using a random forest model.""" | ||
|
||
def __init__( | ||
self, | ||
lags: list[int], | ||
quantiles: list[float], | ||
include_seasonal_dummies=True, | ||
cyclical_encodings=True, | ||
include_rolling_stats=False, | ||
X_lag_cols: list[str] | None = None, | ||
kwargs: dict | None = None, | ||
): | ||
self.kwargs = kwargs or {} | ||
model = RandomForestQuantileRegressor( | ||
default_quantiles=quantiles, | ||
**self.kwargs, | ||
) | ||
super().__init__( | ||
model=model, | ||
lags=lags, | ||
quantiles=quantiles, | ||
include_seasonal_dummies=include_seasonal_dummies, | ||
include_rolling_stats=include_rolling_stats, | ||
cyclical_encodings=cyclical_encodings, | ||
X_lag_cols=X_lag_cols, | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.