transfer_learning_factory#

Factory for creating a transfer learning models.

exception ModelNotFoundError#

Bases: Exception

Raised when a model type is not found.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

create(model_id: str, model_dict: dict[str, object], time_series_params: TimeSeriesConfig) TransferLearningModel#

Create a model of a specific type, given JSON data.

Parameters:
  • model_id – the model type to create.

  • model_dict – the JSON data to use to create the model.

  • time_series_params – the time series configuration.

Returns:

The created model if model can be created, None otherwise.

Raises:

ModelNotFoundError – if the model type is unknown.

register(model_id: str, config_class: type[simba_ml.prediction.time_series.models.model.ModelConfig], model_class: type[simba_ml.prediction.time_series.models.transfer_learning_model.TransferLearningModel]) None#

Register a new model type.

Parameters:
  • model_id – the model type to register.

  • config_class – the configuration class for the model.

  • model_class – the model class.

unregister(model_id: str) None#

Unregister a model type.

Parameters:

model_id – the model type to unregister.