# 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 numpy as np
import pandas as pd
import os
from src.main import config
        file_prefix="negative"

    # Determine file_list based on Mode
    if mode == "V":
        #file_list = ["_CLM.csv","_CLM_3D.csv","_CLM_Gaze.csv","_CLM_pose.csv","_FACET.csv"]
        file_list = ["_OPENFACE.csv"]
    elif mode == "A":
        file_list = ["_COVAREP.csv","_FORMANT.csv"]
    else:
        file_list = ["_LIWC.csv"]

    # Determine final file list for Question Type and Mode passed
    for i in range(len(file_list)):
        file_list[i] = file_prefix+file_list[i]
    print "File List: ",file_list

    # Determine directory
    dir=config.POS_NEG_DIR

    # Obtain file list with complete path
    file1 = os.path.join(dir,file_list[0])
    files = [os.path.join(dir,arg) for arg in file_list[1:]]

    # Obtain data frame containing all features from determined file list for TESTING SET
    TEST = "y"
    feature_list.append("video")
    feature_list.append("label")
    feature_list.append("score")
    df = get_feature_df(TEST,file1,files)
    df_new = df[feature_list]

# 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/select_test_features.py
import numpy as np
import pandas as pd
import os
from src.main import config

        file_prefix="negative"

    # Determine file_list based on Mode
    if mode == "V":
        #file_list = ["_CLM.csv","_CLM_3D.csv","_CLM_Gaze.csv","_CLM_pose.csv","_FACET.csv"]
        file_list = ["_OPENFACE.csv"]
    elif mode == "A":
        file_list = ["_COVAREP.csv","_FORMANT.csv"]
    else:
        file_list = ["_LIWC.csv"]

    # Determine final file list for Question Type and Mode passed
    for i in range(len(file_list)):
        file_list[i] = file_prefix+file_list[i]
    print "File List: ",file_list

    # Determine directory
    dir=config.POS_NEG_DIR

    # Obtain file list with complete path
    file1 = os.path.join(dir,file_list[0])
    files = [os.path.join(dir,arg) for arg in file_list[1:]]

    # Obtain data frame containing all features from determined file list for TESTING SET
    TEST = "y"
    feature_list.append("video")
    feature_list.append("label")
    feature_list.append("score")
    df = get_feature_df(TEST,file1,files)
    df_new = df[feature_list]

    df_new.to_csv(config.SEL_FEAT)