Skip to content

Commit

Permalink
Merge pull request #19 from WenjieDu/dev
Browse files Browse the repository at this point in the history
Add random walk dataset and release v0.3
  • Loading branch information
WenjieDu authored Sep 12, 2024
2 parents fcc304d + 975e0eb commit f7d4c97
Show file tree
Hide file tree
Showing 16 changed files with 383 additions and 12 deletions.
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
repos:
# hooks for checking files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml

# hooks for linting code
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
args: [
--line-length=120, # refer to pyproject.toml
]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
args: [
--max-line-length=120, # refer to pyproject.toml
--extend-ignore=E203,E231
]
2 changes: 2 additions & 0 deletions benchpots/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .physionet_2019 import preprocess_physionet2019
from .ucr_uea_datasets import preprocess_ucr_uea_datasets
from .solar_alabama import preprocess_solar_alabama
from .random_walk import preprocess_random_walk

__all__ = [
"preprocess_physionet2012",
Expand All @@ -25,4 +26,5 @@
"preprocess_pems_traffic",
"preprocess_ucr_uea_datasets",
"preprocess_solar_alabama",
"preprocess_random_walk",
]
1 change: 0 additions & 1 deletion benchpots/datasets/beijing_multisite_air_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def preprocess_beijing_air_quality(
processed_dataset["val_X_ori"] = val_X_ori

processed_dataset["test_X"] = test_X
# test_X_ori is for error calc, not for model input, hence mustn't have NaNs
processed_dataset["test_X_ori"] = test_X_ori
else:
logger.warning("rate is 0, no missing values are artificially added.")
Expand Down
1 change: 0 additions & 1 deletion benchpots/datasets/electricity_load_diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def preprocess_electricity_load_diagrams(
processed_dataset["val_X_ori"] = val_X_ori

processed_dataset["test_X"] = test_X
# test_X_ori is for error calc, not for model input, hence mustn't have NaNs
processed_dataset["test_X_ori"] = test_X_ori
else:
logger.warning("rate is 0, no missing values are artificially added.")
Expand Down
2 changes: 1 addition & 1 deletion benchpots/datasets/electricity_transformer_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def preprocess_ett(
processed_dataset["val_X_ori"] = val_X_ori

processed_dataset["test_X"] = test_X
# test_X_ori is for error calc, not for model input, hence mustn't have NaNs

processed_dataset["test_X_ori"] = test_X_ori
else:
logger.warning("rate is 0, no missing values are artificially added.")
Expand Down
1 change: 0 additions & 1 deletion benchpots/datasets/italy_air_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def preprocess_italy_air_quality(
processed_dataset["val_X_ori"] = val_X_ori

processed_dataset["test_X"] = test_X
# test_X_ori is for error calc, not for model input, hence mustn't have NaNs
processed_dataset["test_X_ori"] = test_X_ori
else:
logger.warning("rate is 0, no missing values are artificially added.")
Expand Down
1 change: 0 additions & 1 deletion benchpots/datasets/pems_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def preprocess_pems_traffic(
processed_dataset["val_X_ori"] = val_X_ori

processed_dataset["test_X"] = test_X
# test_X_ori is for error calc, not for model input, hence mustn't have NaNs
processed_dataset["test_X_ori"] = test_X_ori
else:
logger.warning("rate is 0, no missing values are artificially added.")
Expand Down
1 change: 0 additions & 1 deletion benchpots/datasets/physionet_2012.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ def apply_func(df_temp): # pad and truncate to set the max length of samples as
)

processed_dataset["test_X"] = test_X
# test_X_ori is for error calc, not for model input, hence mustn't have NaNs
processed_dataset["test_X_ori"] = test_X_ori

test_X_indicating_mask = np.isnan(test_X_ori) ^ np.isnan(test_X)
Expand Down
1 change: 0 additions & 1 deletion benchpots/datasets/physionet_2019.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ def apply_func(df_temp): # pad and truncate to set the max length of samples as
processed_dataset["val_X_ori"] = val_X_ori

processed_dataset["test_X"] = test_X
# test_X_ori is for error calc, not for model input, hence mustn't have NaNs
processed_dataset["test_X_ori"] = test_X_ori

test_X_indicating_mask = np.isnan(test_X_ori) ^ np.isnan(test_X)
Expand Down
Loading

0 comments on commit f7d4c97

Please sign in to comment.