From 92c28d77d60149070f0ab37bf81b3eaf493dc148 Mon Sep 17 00:00:00 2001 From: "Dr. Kashif Rasul" Date: Fri, 15 May 2020 10:53:40 +0200 Subject: [PATCH] get dataset returns shuffled training data by default --- pts/dataset/repository/datasets.py | 4 ++++ pts/dataset/utils.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/pts/dataset/repository/datasets.py b/pts/dataset/repository/datasets.py index e173e6f..58cc7c9 100644 --- a/pts/dataset/repository/datasets.py +++ b/pts/dataset/repository/datasets.py @@ -133,6 +133,7 @@ def materialize_dataset( def get_dataset( dataset_name: str, path: Path = default_dataset_path, regenerate: bool = False, + shuffle: bool = True, ) -> TrainDatasets: """ Get a repository dataset. @@ -151,6 +152,8 @@ def get_dataset( be downloaded again. path where the dataset should be saved + shuffle + wheather to shuffle the training time series Returns ------- dataset obtained by either downloading or reloading from local file. @@ -161,6 +164,7 @@ def get_dataset( metadata=dataset_path / "metadata.json", train=dataset_path / "train" / "*.json", test=dataset_path / "test" / "*.json", + shuffle=shuffle ) diff --git a/pts/dataset/utils.py b/pts/dataset/utils.py index 5178a1d..f7e30c0 100644 --- a/pts/dataset/utils.py +++ b/pts/dataset/utils.py @@ -67,6 +67,8 @@ def load_datasets(metadata, train, test, shuffle: bool = False) -> TrainDatasets Path to the training dataset files. test Path to the test dataset files. + shuffle + Return shuffled train data. Returns ------- TrainDatasets