def read_3D_dataset(input_data_directory_with_date: str, label_name: str): """ Read data set under the given directory, return data and label :param input_data_directory_with_date: input data directory with time where train.csv and test.csv exist :param label_name: name of label column in numpy array :return data: data in numpy array :return label: label in series """ # Get file names train_data_file_path = os.path.join(input_data_directory_with_date, "train_data.npy") train_label_file_path = os.path.join(input_data_directory_with_date, "train_label.npy") test_data_file_path = os.path.join(input_data_directory_with_date, "test_data.npy") test_label_file_path = os.path.join(input_data_directory_with_date, "test_label.npy") # Check if the given data set exist FileUtil.is_valid_file(train_data_file_path) FileUtil.is_valid_file(train_label_file_path) FileUtil.is_valid_file(test_data_file_path) FileUtil.is_valid_file(test_label_file_path) # Read csv file train_data = FileUtil.load_3D_array(train_data_file_path) train_label = FileUtil.load_3D_array(train_label_file_path) test_data = FileUtil.load_3D_array(test_data_file_path) test_label = FileUtil.load_3D_array(test_label_file_path) return train_data, test_data, train_label, test_label