# Path: skTMVA/skTMVA.py
# def convert_bdt_sklearn_tmva(sklearn_bdt_clf, input_var_list, tmva_outfile_xml):
# 
#     # AdaBoost
#     if isinstance(sklearn_bdt_clf, AdaBoostClassifier):
#         convert_bdt__AdaBoost(sklearn_bdt_clf, input_var_list, tmva_outfile_xml)
# 
#     # Gradient Boosting (binary classification only)
#     if isinstance(sklearn_bdt_clf, GradientBoostingClassifier):
#         convert_bdt__Grad(sklearn_bdt_clf, input_var_list, tmva_outfile_xml)


from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import AdaBoostClassifier
from skTMVA import convert_bdt_sklearn_tmva
from numpy.random import RandomState
import cPickle
import numpy as np




RNG = RandomState(21)

# Construct an example dataset for binary classification
n_vars = 2
n_events = 10000
signal = RNG.multivariate_normal(
    np.ones(n_vars), np.diag(np.ones(n_vars)), n_events)
background = RNG.multivariate_normal(
    np.ones(n_vars) * -1, np.diag(np.ones(n_vars)), n_events)
X = np.concatenate([signal, background])
y = np.ones(X.shape[0])
w = RNG.randint(1, 10, n_events * 2)
y[signal.shape[0]:] *= -1

# Path: skTMVA/skTMVA.py
# def convert_bdt_sklearn_tmva(sklearn_bdt_clf, input_var_list, tmva_outfile_xml):
# 
#     # AdaBoost
#     if isinstance(sklearn_bdt_clf, AdaBoostClassifier):
#         convert_bdt__AdaBoost(sklearn_bdt_clf, input_var_list, tmva_outfile_xml)
# 
#     # Gradient Boosting (binary classification only)
#     if isinstance(sklearn_bdt_clf, GradientBoostingClassifier):
#         convert_bdt__Grad(sklearn_bdt_clf, input_var_list, tmva_outfile_xml)


# Path: examples/bdt_sklearn_to_tmva_AdaBoost.py
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import AdaBoostClassifier
from skTMVA import convert_bdt_sklearn_tmva
from numpy.random import RandomState
import cPickle
import numpy as np





RNG = RandomState(21)

# Construct an example dataset for binary classification
n_vars = 2
n_events = 10000
signal = RNG.multivariate_normal(
    np.ones(n_vars), np.diag(np.ones(n_vars)), n_events)
background = RNG.multivariate_normal(
    np.ones(n_vars) * -1, np.diag(np.ones(n_vars)), n_events)
X = np.concatenate([signal, background])
y = np.ones(X.shape[0])
w = RNG.randint(1, 10, n_events * 2)
y[signal.shape[0]:] *= -1

permute = RNG.permutation(y.shape[0])