"""
Author: Federica Lionetto
Date: November 6th, 2015

Description:
Import modules used for training.

How to run it:
Include it in other python scripts.
"""

import ROOT as ROOT

import os
import time

import sys 
sys.path.insert(0,'../CreateNtuples')
from CreateNtuples_ToolsFile import *

import subprocess

import yaml
import argparse

import collections

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt 
from pylab import *

import numpy as np
import root_numpy as rnp 
import pandas as pd
import root_pandas as rpd

import pandas.core.common as com
from pandas.core.index import Index

from rep.utils import train_test_split
from rep.utils import calc_feature_correlation_matrix
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve
from sklearn.metrics import auc
from sklearn.metrics import zero_one_loss

# from rep.data.storage import LabeledDataStorage
# from rep.report import ClassificationReport

from sklearn.tree import DecisionTreeClassifier

from sklearn.grid_search import GridSearchCV
from sklearn.cross_validation import train_test_split
from sklearn.metrics import classification_report

from rep.estimators import TMVAClassifier
from rep.estimators import SklearnClassifier
from rep.estimators.xgboost import XGBoostClassifier
from rep.estimators.pybrain import PyBrainClassifier
from rep.estimators.neurolab import NeurolabClassifier
# from rep.estimators.theanets import TheanetsClassifier

# Classifiers for uniformity
from hep_ml.uboost import uBoostClassifier
from hep_ml.gradientboosting import UGradientBoostingClassifier, KnnAdaLossFunction, KnnFlatnessLossFunction

from sklearn.ensemble import GradientBoostingClassifier
from sklearn.ensemble import ExtraTreesClassifier

from hep_ml.commonutils import train_test_split
from hep_ml import uboost, gradientboosting as ugb, losses
from hep_ml.metrics import KnnBasedSDE, KnnBasedCvM

from rep.report.metrics import RocAuc, LogLoss, OptimalMetric, ams

from rep.metaml.gridsearch import RandomParameterOptimizer, AnnealingParameterOptimizer, SubgridParameterOptimizer, RegressionParameterOptimizer
from rep.metaml import FoldingClassifier
from rep.metaml import FoldingScorer
from rep.metaml import GridOptimalSearchCV
from rep.metaml import ClassifiersFactory

from copy import deepcopy

# Import modules for recursive feature elimination.
from sklearn.svm import SVC
from sklearn.cross_validation import StratifiedKFold
from sklearn.cross_validation import LeaveOneOut
from sklearn.feature_selection import RFECV
from sklearn.feature_selection import RFE
from sklearn.datasets import make_classification

from sklearn.gaussian_process import GaussianProcess

from sklearn.decomposition import PCA

import itertools
from itertools import combinations
from itertools import chain

import fnmatch
 
from array import array

import cPickle as pickle
