tempor.datasources.prediction.one_off.plugin_sine module

Module with the sine data source.

class tempor.datasources.prediction.one_off.plugin_sine.SineDataSource(no: int = 100, seq_len: int = 10, temporal_dim: int = 5, static_dim: int = 4, freq_scale: float = 1, with_missing: bool = False, miss_ratio: float = 0.1, static_scale: float = 1.0, ts_scale: float = 1.0, random_state: int = 42, **kwargs: Any)[source]

Bases: OneOffPredictionDataSource

Sinusoidal data generation. See source code for the specifics.

Parameters:
no : int, optional

The number of samples. Defaults to 100.

seq_len : int, optional

Sequence length of the time-series. Defaults to 10.

temporal_dim : int, optional

Time-series feature dimensions. Defaults to 5.

static_dim : int, optional

Static feature dimensions. Defaults to 4.

freq_scale : float, optional

The frequency scaling multiplier for the signal (sin(freq_scale * random_drawn_freq * x + phase)). Defaults to 1.

with_missing : bool, optional

Whether to generate missing data points (np.nan). Defaults to False.

miss_ratio : float, optional

The ration of missing data points. Defaults to 0.1.

static_scale : float, optional

The scaling factor to apply to the static data. Defaults to 1.0.

ts_scale : float, optional

The scaling factor to apply to the time series data. Defaults to 1.0.

random_state : int, optional

The random seed to set for numpy.random.seed. Defaults to 42.

**kwargs : Any

Any additional keyword arguments will be passed to parent class constructor.

static url() None[source]

Define the URL of the data source, if relevant, otherwise return None.

Returns:

The URL of the data source, if relevant, otherwise None.

Return type:

Optional[str]

static dataset_dir() None[source]

The path to the directory where the data file(s) will be stored, if relevant. If the data source has no data files, return None.

Note

the path should correspond to a subdirectory within data_root_dir.

Returns:

The path of the directory where the data file(s) will be stored, if relevant, else None.

Return type:

Optional[str]

load(**kwargs: Any) OneOffPredictionDataset[source]

The method that should return a one-off prediction dataset.

Parameters:
**kwargs : Any

Any additional keyword arguments.

Returns:

The loaded dataset.

Return type:

dataset.OneOffPredictionDataset

category : ClassVar[plugin_typing.PluginCategory] = 'prediction.one_off'

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

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

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

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

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