# Path: src/models/classifier.py
# class MetaClassifier(BaseEstimator, ClassifierMixin):
# class LateFusionClassifier(BaseEstimator, ClassifierMixin):
#     def __init__(self, classifiers, vote='probability',
#                 weights=None, method='majority_voting'):
#     def fit(self, X_list, y_list, nested=True):
#     def predict(self, X_list):
#     def predict_proba(self, X_list, get_all=False):
#     def score(self, Xs, y_true, scoring='f1'):
#     def __init__(self,classifiers,vote='classlabel',weights=None):
#     def fit(self,Xs,ys):
#     def predict(self,Xs):
#     def predict_proba(self, Xs, get_all=False):
#     def score(self,Xs,y_true,scoring='f1'):


import itertools
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import src.main.config
import src.obsolete.utils
import src.obsolete.utils
from sklearn.metrics import confusion_matrix
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve
from src.models import classifier

def plot_roc_curve(fpr_a,tpr_a,roc_area_a,fpr_v,tpr_v,roc_area_v,fpr_l,tpr_l,roc_area_l):

    plt.xlabel('False Positive Rate')
    plt.ylabel('True Positive Rate')
    plt.title('Receiver operating characteristic')
    plt.xlim([0.0, 1.0])
    plt.ylim([0.0, 1.0])
    plt.plot(fpr_a, tpr_a,lw=2,label='ROC Acoustic (area = %0.2f)' % roc_area_a)
    plt.plot(fpr_v, tpr_v,lw=2,label='ROC Visual (area = %0.2f)' % roc_area_v)
    plt.plot(fpr_l, tpr_l,lw=2,label='ROC Linguistic (area = %0.2f)' % roc_area_l)
    plt.legend(loc="best")
    plt.show()

def plot_roc_latefusion(fpr,tpr,roc_area):
    plt.xlabel('False Positive Rate')
    plt.ylabel('True Positive Rate')
    plt.title('Receiver operating characteristic')
    plt.xlim([0.0, 1.0])
    plt.ylim([0.0, 1.0])
    plt.plot(fpr, tpr, lw=2, label='ROC Late Fusion(area = %0.2f)' % roc_area)
    plt.legend(loc="best")
    plt.show()
class_names = ["Non-Depressed","Depressed"]
def late_fusion_model(clf1_a,clf2_a,clf1_v,clf2_v,clf1_l,clf2_l):
    # Read the data
    Xs_train, ys_train, Xs_val, ys_val = src.obsolete.utils.get_multi_data()
    clf_A = classifier.MetaClassifier(classifiers=[clf1_a, clf2_a])
    clf_V = classifier.MetaClassifier(classifiers=[clf1_v, clf2_v])
    clf_L = classifier.MetaClassifier(classifiers=[clf1_l, clf2_l])

# Path: src/models/classifier.py
# class MetaClassifier(BaseEstimator, ClassifierMixin):
# class LateFusionClassifier(BaseEstimator, ClassifierMixin):
#     def __init__(self, classifiers, vote='probability',
#                 weights=None, method='majority_voting'):
#     def fit(self, X_list, y_list, nested=True):
#     def predict(self, X_list):
#     def predict_proba(self, X_list, get_all=False):
#     def score(self, Xs, y_true, scoring='f1'):
#     def __init__(self,classifiers,vote='classlabel',weights=None):
#     def fit(self,Xs,ys):
#     def predict(self,Xs):
#     def predict_proba(self, Xs, get_all=False):
#     def score(self,Xs,y_true,scoring='f1'):


# Path: src/obsolete/plot_roc.py
import itertools
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import src.main.config
import src.obsolete.utils
import src.obsolete.utils
from sklearn.metrics import confusion_matrix
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve
from src.models import classifier


def plot_roc_curve(fpr_a,tpr_a,roc_area_a,fpr_v,tpr_v,roc_area_v,fpr_l,tpr_l,roc_area_l):

    plt.xlabel('False Positive Rate')
    plt.ylabel('True Positive Rate')
    plt.title('Receiver operating characteristic')
    plt.xlim([0.0, 1.0])
    plt.ylim([0.0, 1.0])
    plt.plot(fpr_a, tpr_a,lw=2,label='ROC Acoustic (area = %0.2f)' % roc_area_a)
    plt.plot(fpr_v, tpr_v,lw=2,label='ROC Visual (area = %0.2f)' % roc_area_v)
    plt.plot(fpr_l, tpr_l,lw=2,label='ROC Linguistic (area = %0.2f)' % roc_area_l)
    plt.legend(loc="best")
    plt.show()

def plot_roc_latefusion(fpr,tpr,roc_area):
    plt.xlabel('False Positive Rate')
    plt.ylabel('True Positive Rate')
    plt.title('Receiver operating characteristic')
    plt.xlim([0.0, 1.0])
    plt.ylim([0.0, 1.0])
    plt.plot(fpr, tpr, lw=2, label='ROC Late Fusion(area = %0.2f)' % roc_area)
    plt.legend(loc="best")
    plt.show()
class_names = ["Non-Depressed","Depressed"]
def late_fusion_model(clf1_a,clf2_a,clf1_v,clf2_v,clf1_l,clf2_l):
    # Read the data
    Xs_train, ys_train, Xs_val, ys_val = src.obsolete.utils.get_multi_data()
    clf_A = classifier.MetaClassifier(classifiers=[clf1_a, clf2_a])
    clf_V = classifier.MetaClassifier(classifiers=[clf1_v, clf2_v])
    clf_L = classifier.MetaClassifier(classifiers=[clf1_l, clf2_l])

    lf_clf = classifier.LateFusionClassifier(classifiers=[clf_A, clf_V, clf_L], weights=[0.4, 0.4, 0.2])