module timeseries.base
¶
Classes¶
class 
truncated documentation 

Base for all timeseries preprocessing automatically applied within a predictor. 

Base class to build a predictor on timeseries. The class computes one or several predictions at each time, between … 

Addition to sklearn.base.RegressorMixin. 
Properties¶
property 
truncated documentation 


HTML representation of estimator. This is redundant with the logic of _repr_mimebundle_. The latter should … 

HTML representation of estimator. This is redundant with the logic of _repr_mimebundle_. The latter should … 
Methods¶
method 
truncated documentation 

Applies the preprocessing to the series. 

Applies the preprocessing to the series. 

Trains the preprocessing and returns the modified X, y, sample_weight. 

Applies the preprocessing. X, y, sample_weight. 

Stores the first values. 

Returns the reverse tranform. 

Tells if there is one preprocessing. 

Scores the prediction using 

Transforms both X and y. Returns X and y, returns sample_weight as well if not None. The … 
Documentation¶
Base class for timeseries.

class
mlinsights.timeseries.base.
BaseReciprocalTimeSeriesTransformer
(context_length=0)[source]¶ Bases:
mlinsights.mlmodel.sklearn_transform_inv.BaseReciprocalTransformer
Base for all timeseries preprocessing automatically applied within a predictor.
 Parameters
context_length – number of previous observations to build or rebuild the observations

__init__
(context_length=0)[source]¶  Parameters
context_length – number of previous observations to build or rebuild the observations

class
mlinsights.timeseries.base.
BaseTimeSeries
(past=1, delay1=1, delay2=2, use_all_past=False, preprocessing=None)[source]¶ Bases:
sklearn.base.BaseEstimator
Base class to build a predictor 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
past – 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__
(past=1, delay1=1, delay2=2, use_all_past=False, preprocessing=None)[source]¶  Parameters
past – 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

_base_fit_predict
(X, y, sample_weight=None)[source]¶ Trains the preprocessing and returns the modified X, y, sample_weight.
 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
X, y, sample_weight
The y series is moved by self.delay1 in the past.

_fit_preprocessing
(X, y, sample_weight=None)[source]¶ Applies the preprocessing. X, y, sample_weight.
 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
X, y, sample_weight

class
mlinsights.timeseries.base.
TimeSeriesRegressorMixin
[source]¶ Bases:
sklearn.base.RegressorMixin
Addition to sklearn.base.RegressorMixin.