sk_learn_model#

Provides an arbitrary sk learn model architecture for prediction.

class SkLearnModel(time_series_params: TimeSeriesConfig, model_params: SkLearnModelConfig)#

Bases: Model

Defines a model that uses the scikit learn library for prediction.

Parameters:

config – configuration for the model.

Initializes the model.

Parameters:
  • time_series_params – configuration for time series tasks.

  • model_params – configuration for the model.

abstract get_model(model_params: SkLearnModelConfig) BaseEstimator#

Returns the model.

Parameters:

model_params – configuration for the model.

property name: str#

Returns the models name.

Returns:

The models name.

predict(data: ndarray[Any, dtype[float64]]) ndarray[Any, dtype[float64]]#

Predicts the next time steps.

Parameters:

data – 3 dimensional numpy array.

Returns:

The predicted next time steps.

train(train: list[numpy.ndarray[Any, numpy.dtype[numpy.float64]]]) None#

Trains the model with the train data flattened to two dimensions.

Parameters:

train – training data.

validate_prediction_input(data: ndarray[Any, dtype[float64]]) None#

Validates the input of the predict function.

Parameters:

data – a single dataframe containing the input data, where the output will be predicted.

Raises:

ValueError – if data has incorrect shape (row length does not equal )

class SkLearnModelConfig(name: str = 'SkLearn Model', normalize: bool = True)#

Bases: ModelConfig

Defines the configuration for the SkLearnModel.