Skip to content

Commit

Permalink
[BUG] fix training data check for TSDA dataset loader (#2100)
Browse files Browse the repository at this point in the history
* fix: training data check for TSDA dataset loader

* use pandas nulls-check instead of numpys
  • Loading branch information
Sebastian Schmidl authored Sep 26, 2024
1 parent 0c76fa9 commit da79e6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aeon/datasets/_tsad_data_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,13 @@ def load_anomaly_detection(
df_meta = df_meta.set_index(["collection_name", "dataset_name"])
metadata = df_meta.loc[name]
if split.lower() == "train":
if metadata["train_path"] is None or np.isnan(metadata["train_path"]):
train_path = metadata["train_path"]
if train_path is None or pd.isnull(train_path):
raise ValueError(
f"Dataset {name} does not have a training partition. Only "
"`split='test'` is supported."
)
dataset_path = data_folder / metadata["train_path"]
dataset_path = data_folder / train_path
else:
dataset_path = data_folder / metadata["test_path"]

Expand Down

0 comments on commit da79e6d

Please sign in to comment.