From a7f152315e981cd7cb09f4ef9e4fa040c76e415b Mon Sep 17 00:00:00 2001 From: mathew Date: Sat, 20 May 2017 10:44:18 +0100 Subject: [PATCH] Removes unused BCI imports Adds paths to the top --- experiments/libs/loaders.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/experiments/libs/loaders.py b/experiments/libs/loaders.py index 50dffcd..d7f4068 100644 --- a/experiments/libs/loaders.py +++ b/experiments/libs/loaders.py @@ -2,11 +2,12 @@ import os import pandas as pd import arff import numpy as np -from experiments.libs.bci_loader import train_dataset_generator, test_dataset_generator, process_runs from functools import reduce _FRAUD_PATH = 'fraud_detection', 'credit_card_fraud_kaggle', 'creditcard.csv' +_IOT_PATH = 'iot', 'sensor_stream_berkeley', 'sensor.arff' +_BCI_PATH = 'bci', 'data.npz' def _get_datapath(): @@ -60,9 +61,9 @@ def load_iot(): ------- pandas DataFrame """ - iot_path = 'iot', 'sensor_stream_berkeley', 'sensor.arff' - dataset = arff.load(open(reduce(os.path.join, iot_path, _get_datapath()))) + + dataset = arff.load(open(reduce(os.path.join, _IOT_PATH, _get_datapath()))) columns = [i[0] for i in dataset['attributes']] return pd.DataFrame(dataset['data'], columns=columns) @@ -81,6 +82,6 @@ def load_bci(): test features test lalels """ - data_path = 'bci', 'data.npz' - npzfile = np.load(reduce(os.path.join, data_path, _get_datapath())) + + npzfile = np.load(reduce(os.path.join, _BCI_PATH, _get_datapath())) return npzfile['train_X'], npzfile['train_y'], npzfile['test_X'], npzfile['test_y']