# Path: src/main/config.py
# TRAIN_SPLIT_FILE = os.path.join('data','classification_data','training_split.csv')
# TEST_SPLIT_FILE = os.path.join('data','classification_data','test_split.csv')
# VAL_SPLIT_FILE = os.path.join('data','classification_data','dev_split.csv')
# D_ND_DIR = os.path.join('data','disc_nondisc')
# POS_NEG_DIR = os.path.join('data','pos_neg')
# SEL_FEAT_TRAIN_REGULAR_CLASSIFY = os.path.join('data','selected_features','regular','classify','train')
# SEL_FEAT_TEST_REGULAR_CLASSIFY = os.path.join('data','selected_features','regular','classify','test')
# SEL_FEAT_VAL_REGULAR_CLASSIFY = os.path.join('data','selected_features','regular','classify','val')
# SEL_FEAT_TRAIN_REGULAR_ESTIMATE = os.path.join('data','selected_features','regular','estimate','train')
# SEL_FEAT_VAL_REGULAR_ESTIMATE = os.path.join('data','selected_features','regular','estimate','val')
# SEL_FEAT_TEST_REGULAR_ESTIMATE = os.path.join('data','selected_features','regular','estimate','test')
# ALL_FEAT_TRAIN_REGULAR_CLASSIFY = os.path.join('data','all_features','regular','classify','train')
# ALL_FEAT_TEST_REGULAR_CLASSIFY = os.path.join('data','all_features','regular','classify','test')
# ALL_FEAT_VAL_REGULAR_CLASSIFY = os.path.join('data','all_features','regular','classify','val')
# ALL_FEAT_TRAIN_REGULAR_ESTIMATE = os.path.join('data','all_features','regular','estimate','train')
# ALL_FEAT_VAL_REGULAR_ESTIMATE = os.path.join('data','all_features','regular','estimate','val')
# ALL_FEAT_TEST_REGULAR_ESTIMATE = os.path.join('data','all_features','regular','estimate','test')
# SEL_FEAT_TRAIN_NORMALIZED_CLASSIFY = os.path.join('data','selected_features','normalize','classify','train')
# SEL_FEAT_VAL_NORMALIZED_CLASSIFY = os.path.join('data','selected_features','normalize','classify','val')
# SEL_FEAT_TRAIN_NORMALIZED_ESTIMATE = os.path.join('data','selected_features','normalize','estimate','train')
# SEL_FEAT_VAL_NORMALIZED_ESTIMATE = os.path.join('data','selected_features','normalize','estimate','val')
# RESULTS_CLASSIFY = os.path.join('results','grid_search','classification')
# RESULTS_ESTIMATE = os.path.join('results','grid_search','regression')
# SEL_FEAT = os.path.join('data','selected_features')
# ALL_FEAT = os.path.join('data','all_features')
# ANOVA_DIR = os.path.join('results','anova')
# GRID_SEARCH_CLF_DIR = os.path.join('results','grid_search','classification')
# GRID_SEARCH_REG_DIR = os.path.join('results','grid_search','regression')


import pandas as pd
import pprint
from sklearn import preprocessing
from src.main import config
    if split != "test":
        for video, group in grouped:
            X_person = []
            y_person = []
            for i in range(len(group)):
                X_person.append(group.iloc[i].tolist()[1:-2])
                y_person.append(group.iloc[i][y_label])
            X.append(X_person)
            y.append(y_person)
        return X, y
    elif split == "test":
        for video, group in grouped:
            X_person = []
            for i in range(len(group)):
                X_person.append(group.iloc[i].tolist()[1:])
            X.append(X_person)
        return X


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":

# Path: src/main/config.py
# TRAIN_SPLIT_FILE = os.path.join('data','classification_data','training_split.csv')
# TEST_SPLIT_FILE = os.path.join('data','classification_data','test_split.csv')
# VAL_SPLIT_FILE = os.path.join('data','classification_data','dev_split.csv')
# D_ND_DIR = os.path.join('data','disc_nondisc')
# POS_NEG_DIR = os.path.join('data','pos_neg')
# SEL_FEAT_TRAIN_REGULAR_CLASSIFY = os.path.join('data','selected_features','regular','classify','train')
# SEL_FEAT_TEST_REGULAR_CLASSIFY = os.path.join('data','selected_features','regular','classify','test')
# SEL_FEAT_VAL_REGULAR_CLASSIFY = os.path.join('data','selected_features','regular','classify','val')
# SEL_FEAT_TRAIN_REGULAR_ESTIMATE = os.path.join('data','selected_features','regular','estimate','train')
# SEL_FEAT_VAL_REGULAR_ESTIMATE = os.path.join('data','selected_features','regular','estimate','val')
# SEL_FEAT_TEST_REGULAR_ESTIMATE = os.path.join('data','selected_features','regular','estimate','test')
# ALL_FEAT_TRAIN_REGULAR_CLASSIFY = os.path.join('data','all_features','regular','classify','train')
# ALL_FEAT_TEST_REGULAR_CLASSIFY = os.path.join('data','all_features','regular','classify','test')
# ALL_FEAT_VAL_REGULAR_CLASSIFY = os.path.join('data','all_features','regular','classify','val')
# ALL_FEAT_TRAIN_REGULAR_ESTIMATE = os.path.join('data','all_features','regular','estimate','train')
# ALL_FEAT_VAL_REGULAR_ESTIMATE = os.path.join('data','all_features','regular','estimate','val')
# ALL_FEAT_TEST_REGULAR_ESTIMATE = os.path.join('data','all_features','regular','estimate','test')
# SEL_FEAT_TRAIN_NORMALIZED_CLASSIFY = os.path.join('data','selected_features','normalize','classify','train')
# SEL_FEAT_VAL_NORMALIZED_CLASSIFY = os.path.join('data','selected_features','normalize','classify','val')
# SEL_FEAT_TRAIN_NORMALIZED_ESTIMATE = os.path.join('data','selected_features','normalize','estimate','train')
# SEL_FEAT_VAL_NORMALIZED_ESTIMATE = os.path.join('data','selected_features','normalize','estimate','val')
# RESULTS_CLASSIFY = os.path.join('results','grid_search','classification')
# RESULTS_ESTIMATE = os.path.join('results','grid_search','regression')
# SEL_FEAT = os.path.join('data','selected_features')
# ALL_FEAT = os.path.join('data','all_features')
# ANOVA_DIR = os.path.join('results','anova')
# GRID_SEARCH_CLF_DIR = os.path.join('results','grid_search','classification')
# GRID_SEARCH_REG_DIR = os.path.join('results','grid_search','regression')


# Path: src/obsolete/read_labels.py
import pandas as pd
import pprint
from sklearn import preprocessing
from src.main import config

    if split != "test":
        for video, group in grouped:
            X_person = []
            y_person = []
            for i in range(len(group)):
                X_person.append(group.iloc[i].tolist()[1:-2])
                y_person.append(group.iloc[i][y_label])
            X.append(X_person)
            y.append(y_person)
        return X, y
    elif split == "test":
        for video, group in grouped:
            X_person = []
            for i in range(len(group)):
                X_person.append(group.iloc[i].tolist()[1:])
            X.append(X_person)
        return X


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"