tempor.methods.prediction.temporal.classification.plugin_seq2seq_classifier module

Temporal classification estimator based on Seq2Seq model.

class tempor.methods.prediction.temporal.classification.plugin_seq2seq_classifier.Seq2seqClassifier(**params: Any)[source]

Bases: BaseTemporalClassifier

Seq2seq classifier.

Parameters:
**params : Any

Parameters and defaults as defined in Seq2seqParams.

Example

>>> import doctest; doctest.ELLIPSIS_MARKER = "[...]"  # Doctest config, ignore.
>>>
>>> from tempor.data import dataset
>>> from tempor import plugin_loader
>>>
>>> raw_data = plugin_loader.get("prediction.one_off.sine", plugin_type="datasource", temporal_dim=5).load()
>>> data = dataset.TemporalPredictionDataset(
...    time_series=raw_data.time_series.dataframe(),
...    static=raw_data.static.dataframe(),
...    targets=raw_data.time_series.dataframe(),
... )
>>>
>>> # Load the model:
>>> model = plugin_loader.get("prediction.temporal.classification.seq2seq_classifier", epochs=10)
>>>
>>> # Train:
>>> model.fit(data)
[...]
>>>
>>> # Predict:
>>> assert model.predict(data, n_future_steps = 10).numpy().shape == (len(data), 10, 5)
>>>
>>> doctest.ELLIPSIS_MARKER = "..."  # Doctest config, ignore.
ParamsDefinition

alias of Seq2seqParams

params : Seq2seqParams
static hyperparameter_space(*args: Any, **kwargs: Any) list[Params][source]

The hyperparameter search domain, used for tuning.

Can provide variadics *args and **kwargs, these will be received from sample_hyperparameters.

category : ClassVar[plugin_typing.PluginCategory] = 'prediction.temporal.classification'

Plugin category, such as 'prediction.one_off.classification'. Must be set by the plugin class using @register_plugin.

name : ClassVar[plugin_typing.PluginName] = 'seq2seq_classifier'

Plugin name, such as 'my_nn_classifier'. Must be set by the plugin class using @register_plugin.

plugin_type : ClassVar[plugin_typing.PluginTypeArg] = 'method'

Plugin type, such as 'method'. May be optionally set by the plugin class using @register_plugin, else will set the default plugin type.