15variables = [
'M',
'p',
'pt',
'pz',
16 'daughter(0, p)',
'daughter(0, pz)',
'daughter(0, pt)',
17 'daughter(1, p)',
'daughter(1, pz)',
'daughter(1, pt)',
18 'daughter(2, p)',
'daughter(2, pz)',
'daughter(2, pt)',
19 'chiProb',
'dr',
'dz',
20 'daughter(0, dr)',
'daughter(1, dr)',
21 'daughter(0, dz)',
'daughter(1, dz)',
22 'daughter(0, chiProb)',
'daughter(1, chiProb)',
'daughter(2, chiProb)',
23 'daughter(0, kaonID)',
'daughter(0, pionID)',
24 'daughterInvM(0, 1)',
'daughterInvM(0, 2)',
'daughterInvM(1, 2)']
27def feature_importance(state):
29 Return a list containing the feature importances
31 print("Called overwritten feature importance")
39 print("Called overwritten load")
44print(
"Executed python script")
46if __name__ ==
"__main__":
50 train_file = basf2.find_file(
'mva/train_D0toKpipi.root',
'examples',
False)
51 test_file = basf2.find_file(
'mva/test_D0toKpipi.root',
'examples',
False)
55 general_options = basf2_mva.GeneralOptions()
56 general_options.m_datafiles = basf2_mva.vector(train_file)
57 general_options.m_treename =
"tree"
58 general_options.m_variables = basf2_mva.vector(*variables)
59 general_options.m_target_variable =
"isSignal"
60 general_options.m_identifier =
"Python.xml"
61 general_options.m_max_events = 200
63 specific_options = basf2_mva.PythonOptions()
64 specific_options.m_training_fraction = 0.9
65 specific_options.m_nIterations = 2
66 specific_options.m_mini_batch_size = 10000
67 specific_options.m_framework =
'test'
72 basf2_mva.teacher(general_options, specific_options)
74 basf2_mva.expert(basf2_mva.vector(
"Python.xml"),
75 basf2_mva.vector(test_file),
'tree',
'expert.root')
77 specific_options.m_steering_file =
'mva/tests/python.py'
78 basf2_mva.teacher(general_options, specific_options)
80 basf2_mva.expert(basf2_mva.vector(
"Python.xml"),
81 basf2_mva.vector(test_file),
'tree',
'expert.root')
def clean_working_directory()
def skip_test(reason, py_case=None)