sk_learn#

Provides the sklearn models.

class DecisionTreeRegressorModel(time_series_params: TimeSeriesConfig, model_params: DecisionTreeRegressorConfig)#

Bases: SkLearnModel

Defines a decisision tree regressor model for predictions.

Initializes the configuration for the DecisionTreeRegressor.

Parameters:
  • time_series_params – Time-series parameters that affect the training and architecture of models

  • model_params – configuration for the model.

get_model(model_params: DecisionTreeRegressorConfig) BaseEstimator#

Returns the model.

Parameters:

model_params – configuration for the model.

Returns:

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 LinearRegressorModel(time_series_params: TimeSeriesConfig, model_params: LinearRegressorConfig)#

Bases: SkLearnModel

Defines a model, which uses a Linear Regressor to predict the next timestamps.

Initializes the configuration for the LinearRegressor.

Parameters:
  • time_series_params – Time-series parameters that affect the training and architecture of models

  • model_params – configuration for the model.

get_model(model_params: LinearRegressorConfig) BaseEstimator#

Returns the model.

Parameters:

model_params – configuration for the model.

Returns:

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 NearestNeighborsRegressorModel(time_series_params: TimeSeriesConfig, model_params: NearestNeighborsConfig)#

Bases: SkLearnModel

Defines a model, which uses a nearest neighbors regressor.

Initializes the configuration for the DecisionTreeRegressor.

Parameters:
  • time_series_params – Time-series parameters that affect the training and architecture of models

  • model_params – configuration for the model.

get_model(model_params: NearestNeighborsConfig) BaseEstimator#

Returns the model.

Parameters:

model_params – configuration for the model.

Returns:

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 RandomForestRegressorModel(time_series_params: TimeSeriesConfig, model_params: RandomForestRegressorConfig)#

Bases: SkLearnModel

Defines a model, which uses a Random Forest regressor.

Initializes the configuration for the RandomForestRegressor.

Parameters:
  • time_series_params – Time-series parameters that affect the training and architecture of models

  • model_params – configuration for the model.

get_model(model_params: RandomForestRegressorConfig) BaseEstimator#

Returns the model.

Parameters:

model_params – configuration for the model.

Returns:

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 SVMRegressorModel(time_series_params: TimeSeriesConfig, model_params: SVMRegressorConfig)#

Bases: SkLearnModel

Defines a model, which uses a SVM regressor.

Initializes the configuration for the SVMRegressor.

Parameters:
  • time_series_params – Time-series parameters that affect the training and architecture of models

  • model_params – configuration for the model.

get_model(model_params: SVMRegressorConfig) BaseEstimator#

Returns the model.

Parameters:

model_params – configuration for the model.

Returns:

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 )

simba_ml.prediction.time_series.models.sk_learn.decision_tree_regressor

Provides a decision tree regressor for prediction.

simba_ml.prediction.time_series.models.sk_learn.linear_regressor

Provides a model, which predicts next timesteps from with a linear regressor.

simba_ml.prediction.time_series.models.sk_learn.nearest_neighbors_regressor

Provides a nearest neighbors regressor, which predicts next timesteps.

simba_ml.prediction.time_series.models.sk_learn.random_forest_regressor

Provides a model, which predicts next timesteps with a random forest regressor.

simba_ml.prediction.time_series.models.sk_learn.sk_learn_model

Provides an arbitrary sk learn model architecture for prediction.

simba_ml.prediction.time_series.models.sk_learn.support_vector_machine_regressor

Provides a support vector machine regressor, which predicts next timesteps with.