module timeseries.ar
#
Short summary#
module mlinsights.timeseries.ar
Auto-regressor for timeseries.
Classes#
class |
truncated documentation |
---|---|
Base class to build a regressor on timeseries. The class computes one or several predictions at each time, between … |
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#
Auto-regressor for timeseries.
- class mlinsights.timeseries.ar.ARTimeSeriesRegressor(estimator='dummy', past=1, delay1=1, delay2=2, use_all_past=False, preprocessing=None)#
Bases:
BaseTimeSeries
,TimeSeriesRegressorMixin
Base class to build a regressor on timeseries. The class computes one or several predictions at each time, between delay1 and delay2. It computes:
with d in [delay1, delay2[ and
.
- 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