16from tmva100_DataPreparation
import variables
17from tmva101_Training
import load_data
21x, y_true, w = load_data(
"test_signal.root",
"test_background.root")
24bdt = ROOT.TMVA.Experimental.RBDT[
""](
"myBDT",
"tmva101.root")
27y_pred = bdt.Compute(x)
30from sklearn.metrics
import roc_curve, auc
31fpr, tpr, _ = roc_curve(y_true, y_pred, sample_weight=w)
32score = auc(fpr, tpr, reorder=
True)
35c = ROOT.TCanvas(
"roc",
"", 600, 600)
36g = ROOT.TGraph(len(fpr), fpr, tpr)
37g.SetTitle(
"AUC = {:.2f}".format(score))
39g.SetLineColor(ROOT.kRed)
41g.GetXaxis().SetRangeUser(0, 1)
42g.GetYaxis().SetRangeUser(0, 1)
43g.GetXaxis().SetTitle(
"False-positive rate")
44g.GetYaxis().SetTitle(
"True-positive rate")