ts_benchmark.baselines.merlion package
The following module is the adapter required for embedding the merlion models into TFB.
ts_benchmark.baselines.merlion.merlion_models module
Functions
|
Generate model factory information for creating Merlion model adapters. |
Classes
|
Merlion model adapter class, used to adapt models in the Merlion framework to meet the requirements of prediction strategies. |
- class MerlionModelAdapter(model_name: str, model_class: type, config_class: type, model_args: dict, allow_label_on_train: bool)[source]
Bases:
objectMerlion model adapter class, used to adapt models in the Merlion framework to meet the requirements of prediction strategies.
- detect_fit(series: pandas.DataFrame, label: pandas.DataFrame) object[source]
Fit a suitable Merlion model on time series data.
- Parameters:
series – Time series data.
label – Label data.
- Returns:
The fitted model object.
- generate_model_factory(model_name: str, model_class: object, config_class: object, required_args: dict, allow_label_on_train: bool) object[source]
Generate model factory information for creating Merlion model adapters.
- Parameters:
model_name – Model name.
model_class – Merlion model class.
config_class – Merlion configuration class.
required_args – Required parameters for model initialization.
allow_label_on_train – Whether to use labels during training.
- Returns:
A dictionary containing the model factory and required parameters.