tempor.datasources.prediction.one_off.plugin_google_stocks module

Module with the Google stocks data source.

class tempor.datasources.prediction.one_off.plugin_google_stocks.GoogleStocksDataSource(seq_len: int = 10, **kwargs: Any)[source]

Bases: OneOffPredictionDataSource

Google stocks data source, as found here: https://raw.githubusercontent.com/PacktPublishing/Learning-Pandas-Second-Edition/master/data/goog.csv

The next day’s opening price is the target.

The samples are the sequence chunks of length seq_len.

Parameters:
seq_len : int, optional

The number of time steps to use. Defaults to 10.

**kwargs : Any

Keyword arguments to be passed to the parent class.

static url() str[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() str[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] = 'google_stocks'

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.