(self, root_path, win_size, step=1, flag="train")
| 419 | |
| 420 | class MSLSegLoader(Dataset): |
| 421 | def __init__(self, root_path, win_size, step=1, flag="train"): |
| 422 | self.flag = flag |
| 423 | self.step = step |
| 424 | self.win_size = win_size |
| 425 | self.scaler = StandardScaler() |
| 426 | data = np.load(os.path.join(root_path, "MSL_train.npy")) |
| 427 | self.scaler.fit(data) |
| 428 | data = self.scaler.transform(data) |
| 429 | test_data = np.load(os.path.join(root_path, "MSL_test.npy")) |
| 430 | self.test = self.scaler.transform(test_data) |
| 431 | self.train = data |
| 432 | self.val = self.test |
| 433 | self.test_labels = np.load(os.path.join(root_path, "MSL_test_label.npy")) |
| 434 | print("test:", self.test.shape) |
| 435 | print("train:", self.train.shape) |
| 436 | |
| 437 | def __len__(self): |
| 438 | if self.flag == "train": |
nothing calls this directly
no test coverage detected