|
11 | 11 | class Elec2(BaseDatasetDownload): |
12 | 12 | """Elec2 dataset [harries1999splice]_. |
13 | 13 |
|
| 14 | + :param file_path: file path for the downloaded file, defaults to None. If None, the file will be downloaded to a temporary file. |
| 15 | + :type file_path: Optional[str] |
| 16 | +
|
| 17 | + :Note: |
| 18 | + Dataset can be downloaded from the following sources (in order of preference): |
| 19 | +
|
| 20 | + - https://nextcloud.ifca.es/index.php/s/2coqgBEpa82boLS/download |
| 21 | + - https://www.openml.org/data/download/2419/electricity-normalized.arff |
| 22 | +
|
14 | 23 | :References: |
15 | 24 |
|
16 | 25 | .. [harries1999splice] Harries, Michael. |
17 | 26 | "Splice-2 comparative evaluation: Electricity pricing." (1999). |
18 | | - """ |
19 | 27 |
|
20 | | - def __init__(self, file_path: Optional[str] = None) -> None: |
21 | | - """Init method. |
| 28 | + :Example: |
22 | 29 |
|
23 | | - :param file_path: file path for the downloaded file |
24 | | - :type file_path: Optional[str] |
25 | | - """ |
| 30 | + >>> from frouros.datasets.real import Elec2 |
| 31 | + >>> elec2 = Elec2() |
| 32 | + >>> elec2.download() |
| 33 | + INFO:frouros:Trying to download data from https://nextcloud.ifca.es/index.php/s/2coqgBEpa82boLS/download to /tmp/tmpro3ienx0 |
| 34 | + >>> dataset = elec2.load() |
| 35 | + >>> dataset |
| 36 | + array([(0. , b'2', 0. , 0.056443, 0.439155, 0.003467, 0.422915, 0.414912, b'UP'), |
| 37 | + (0. , b'2', 0.021277, 0.051699, 0.415055, 0.003467, 0.422915, 0.414912, b'UP'), |
| 38 | + (0. , b'2', 0.042553, 0.051489, 0.385004, 0.003467, 0.422915, 0.414912, b'UP'), |
| 39 | + ..., |
| 40 | + (0.9158, b'7', 0.957447, 0.043593, 0.34097 , 0.002983, 0.247799, 0.362281, b'DOWN'), |
| 41 | + (0.9158, b'7', 0.978723, 0.066651, 0.329366, 0.00463 , 0.345417, 0.206579, b'UP'), |
| 42 | + (0.9158, b'7', 1. , 0.050679, 0.288753, 0.003542, 0.355256, 0.23114 , b'DOWN')], |
| 43 | + dtype=[('date', '<f8'), ('day', 'S1'), ('period', '<f8'), ('nswprice', '<f8'), ('nswdemand', '<f8'), ('vicprice', '<f8'), ('vicdemand', '<f8'), ('transfer', '<f8'), ('class', 'S4')]) |
| 44 | + """ # noqa: E501 # pylint: disable=line-too-long |
| 45 | + |
| 46 | + def __init__( # noqa: D107 |
| 47 | + self, |
| 48 | + file_path: Optional[str] = None, |
| 49 | + ) -> None: |
26 | 50 | super().__init__( |
27 | 51 | url=[ |
28 | 52 | "https://nextcloud.ifca.es/index.php/s/2coqgBEpa82boLS/download", |
|
0 commit comments