Elec2#

class frouros.datasets.real.Elec2(file_path: str | None = None)#

Elec2 dataset [harries1999splice].

Parameters:

file_path (Optional[str]) – file path for the downloaded file, defaults to None. If None, the file will be downloaded to a temporary file.

Note:

Dataset can be downloaded from the following sources (in order of preference):

References:

[harries1999splice]

Harries, Michael. “Splice-2 comparative evaluation: Electricity pricing.” (1999).

Example:

>>> from frouros.datasets.real import Elec2
>>> elec2 = Elec2()
>>> elec2.download()
INFO:frouros:Trying to download data from https://nextcloud.ifca.es/index.php/s/2coqgBEpa82boLS/download to /tmp/tmpro3ienx0
>>> dataset = elec2.load()
>>> dataset
array([(0.    , b'2', 0.      , 0.056443, 0.439155, 0.003467, 0.422915, 0.414912, b'UP'),
   (0.    , b'2', 0.021277, 0.051699, 0.415055, 0.003467, 0.422915, 0.414912, b'UP'),
   (0.    , b'2', 0.042553, 0.051489, 0.385004, 0.003467, 0.422915, 0.414912, b'UP'),
   ...,
   (0.9158, b'7', 0.957447, 0.043593, 0.34097 , 0.002983, 0.247799, 0.362281, b'DOWN'),
   (0.9158, b'7', 0.978723, 0.066651, 0.329366, 0.00463 , 0.345417, 0.206579, b'UP'),
   (0.9158, b'7', 1.      , 0.050679, 0.288753, 0.003542, 0.355256, 0.23114 , b'DOWN')],
  dtype=[('date', '<f8'), ('day', 'S1'), ('period', '<f8'), ('nswprice', '<f8'), ('nswdemand', '<f8'), ('vicprice', '<f8'), ('vicdemand', '<f8'), ('transfer', '<f8'), ('class', 'S4')])
read_file(**kwargs: Any) ndarray#

Read file.

Parameters:

kwargs (Any) – additional arguments

Returns:

read file

Return type:

numpy.ndarray

download() None#

Download dataset.

Raises:

DownloadError – Download exception

property file_path: Path | None#

File path property.

Returns:

file path for the downloaded dataset

Return type:

Optional[Path]

load(**kwargs: Any) Any#

Load dataset.

Parameters:

kwargs (Any) – additional arguments

Raises:
  • FileNotFoundError – File not found exception

  • ReadFileError – Read file exception

Returns:

loaded dataset

Return type:

Any

property url: str | list[str]#

URL property.

Returns:

URL from where dataset will be downloaded

Return type:

Union[str, list[str]]