module timeseries.dummies
#
Short summary#
module mlinsights.timeseries.dummies
Dummy auto-regressor which takes past values as predictions.
Classes#
class |
truncated documentation |
---|---|
Dummy regressor for time series. Use past values as prediction. |
Properties#
property |
truncated documentation |
---|---|
|
HTML representation of estimator. This is redundant with the logic of _repr_mimebundle_. The latter should … |
Methods#
method |
truncated documentation |
---|---|
Trains the model. |
|
Returns the prediction |
Documentation#
Dummy auto-regressor which takes past values as predictions.
- class mlinsights.timeseries.dummies.DummyTimeSeriesRegressor(estimator='dummy', past=1, delay1=1, delay2=2, use_all_past=False, preprocessing=None)#
Bases:
BaseTimeSeries
,TimeSeriesRegressorMixin
Dummy regressor for time series. Use past values as prediction.
- Parameters:
estimator – estimator to use for regression, sklearn.linear_model.LinearRegression implements a linear auto-regressor,
'dummy'
use past value as predictionspast – values to use to predict
delay1 – the model computes the first prediction for time=t + delay1
delay2 – the model computes the last prediction for time=t + delay2 excluded
use_all_past – use all past features, not only the timeseries
preprocessing – preprocessing to apply before predicting, only the timeseries itselves, it can be a difference, it must be of type
BaseReciprocalTimeSeriesTransformer
- __init__(estimator='dummy', past=1, delay1=1, delay2=2, use_all_past=False, preprocessing=None)#
- Parameters:
estimator – estimator to use for regression, sklearn.linear_model.LinearRegression implements a linear auto-regressor,
'dummy'
use past value as predictionspast – values to use to predict
delay1 – the model computes the first prediction for time=t + delay1
delay2 – the model computes the last prediction for time=t + delay2 excluded
use_all_past – use all past features, not only the timeseries
preprocessing – preprocessing to apply before predicting, only the timeseries itselves, it can be a difference, it must be of type
BaseReciprocalTimeSeriesTransformer
- fit(X, y, sample_weight=None)#
Trains the model.
- Parameters:
X – output of X may be empty (None)
y – timeseries (one single vector), array [n_obs]
sample_weight – weights None or array [n_obs]
- Returns:
self
- predict(X, y)#
Returns the prediction