# Path: src/obsolete/read_labels.py
# def features(mode, category, split, problem_type='C', feature_scale=False, count="all", select = "select"):
#     normalize = 'normalize' if feature_scale else 'regular'
#     if problem_type == "C":
#         directory = "classify"
#     else:
#         directory = "estimate"
#     if select == "select":
#         sel = "selected_features"
#     else:
#         sel = "all_features"
#     if mode == "visual":
#         file_ = "data/"+sel+"/"+normalize+"/"+directory+"/"+split+"/"+category+"_visual_"+split+".csv"
#     elif mode == "acoustic":
#         file_ = "data/"+sel+"/"+normalize+"/"+directory+"/"+split+"/"+category+"_acoustic_"+split+".csv"
#     elif mode == "linguistic":
#         file_ = "data/"+sel+"/"+normalize+"/"+directory+"/"+split+"/"+category+"_linguistic_"+split+".csv"
#     data = pd.read_csv(file_)
#     if split == "train" and count != "all":
#         split_file = config.TRAIN_SPLIT_FILE
#         split_df = pd.read_csv(split_file,usecols=['Participant_ID'])
#         split_df = split_df.loc[:int(count)-1]
#         data = data[data['video'].isin(split_df['Participant_ID'])]
#     return get_features(data, split, problem_type)


import numpy as np
import pandas as pd
from src.obsolete.read_labels import features

    Returns:
        X_train: 3D numpy array
        y_train: 2D numpy array
        X_val: 3D numpy array
        y_val: 2D numpy array
    """

    if category == 'PN':
        cat_1 = "positive"
        cat_2 = "negative"
    else:
        cat_1 = "discriminative"
        cat_2 = "nondiscriminative"

    # print mode, category, problem_type, feature_scale

    X_train = [map(np.asarray, features(mode, cat_1, "train", problem_type, feature_scale, count=count)[0]),
               map(np.asarray, features(mode, cat_2, "train", problem_type, feature_scale, count=count)[0])]
    y_train = [map(np.asarray, features(mode, cat_1, "train", problem_type, feature_scale, count=count)[1]),
               map(np.asarray, features(mode, cat_2, "train", problem_type, feature_scale, count=count)[1])]
    X_val = [map(np.asarray, features(mode, cat_1, "val", problem_type, feature_scale)[0]),
             map(np.asarray, features(mode, cat_2, "val", problem_type, feature_scale)[0])]
    y_val = [map(np.asarray, features(mode, cat_1, "val", problem_type, feature_scale)[1]),
             map(np.asarray, features(mode, cat_2, "val", problem_type, feature_scale)[1])]

    X_train = [map(np.asarray, features(mode, cat_1, "train", problem_type, feature_scale, count = count, select = select)[0]),
               map(np.asarray, features(mode, cat_2, "train", problem_type, feature_scale, count = count, select = select)[0])]
    y_train = [map(np.asarray, features(mode, cat_1, "train", problem_type, feature_scale, count = count, select = select)[1]),
               map(np.asarray, features(mode, cat_2, "train", problem_type, feature_scale, count = count, select = select)[1])]

# Path: src/obsolete/read_labels.py
# def features(mode, category, split, problem_type='C', feature_scale=False, count="all", select = "select"):
#     normalize = 'normalize' if feature_scale else 'regular'
#     if problem_type == "C":
#         directory = "classify"
#     else:
#         directory = "estimate"
#     if select == "select":
#         sel = "selected_features"
#     else:
#         sel = "all_features"
#     if mode == "visual":
#         file_ = "data/"+sel+"/"+normalize+"/"+directory+"/"+split+"/"+category+"_visual_"+split+".csv"
#     elif mode == "acoustic":
#         file_ = "data/"+sel+"/"+normalize+"/"+directory+"/"+split+"/"+category+"_acoustic_"+split+".csv"
#     elif mode == "linguistic":
#         file_ = "data/"+sel+"/"+normalize+"/"+directory+"/"+split+"/"+category+"_linguistic_"+split+".csv"
#     data = pd.read_csv(file_)
#     if split == "train" and count != "all":
#         split_file = config.TRAIN_SPLIT_FILE
#         split_df = pd.read_csv(split_file,usecols=['Participant_ID'])
#         split_df = split_df.loc[:int(count)-1]
#         data = data[data['video'].isin(split_df['Participant_ID'])]
#     return get_features(data, split, problem_type)


# Path: src/obsolete/utils.py
import numpy as np
import pandas as pd
from src.obsolete.read_labels import features


    Returns:
        X_train: 3D numpy array
        y_train: 2D numpy array
        X_val: 3D numpy array
        y_val: 2D numpy array
    """

    if category == 'PN':
        cat_1 = "positive"
        cat_2 = "negative"
    else:
        cat_1 = "discriminative"
        cat_2 = "nondiscriminative"

    # print mode, category, problem_type, feature_scale

    X_train = [map(np.asarray, features(mode, cat_1, "train", problem_type, feature_scale, count=count)[0]),
               map(np.asarray, features(mode, cat_2, "train", problem_type, feature_scale, count=count)[0])]
    y_train = [map(np.asarray, features(mode, cat_1, "train", problem_type, feature_scale, count=count)[1]),
               map(np.asarray, features(mode, cat_2, "train", problem_type, feature_scale, count=count)[1])]
    X_val = [map(np.asarray, features(mode, cat_1, "val", problem_type, feature_scale)[0]),
             map(np.asarray, features(mode, cat_2, "val", problem_type, feature_scale)[0])]
    y_val = [map(np.asarray, features(mode, cat_1, "val", problem_type, feature_scale)[1]),
             map(np.asarray, features(mode, cat_2, "val", problem_type, feature_scale)[1])]

    X_train = [map(np.asarray, features(mode, cat_1, "train", problem_type, feature_scale, count = count, select = select)[0]),
               map(np.asarray, features(mode, cat_2, "train", problem_type, feature_scale, count = count, select = select)[0])]
    y_train = [map(np.asarray, features(mode, cat_1, "train", problem_type, feature_scale, count = count, select = select)[1]),
               map(np.asarray, features(mode, cat_2, "train", problem_type, feature_scale, count = count, select = select)[1])]

    X_val = [map(np.asarray, features(mode, cat_1, "val", problem_type, feature_scale, select = select)[0]),