Public Member Functions | |
__init__ (self, identifier) | |
train_teacher (self, datafiles, treename, general_options=None, specific_options=None) | |
apply_expert (self, datafiles, treename) | |
Public Attributes | |
identifier = identifier | |
Identifier of the method. | |
weightfile = ROOT.Belle2.MVA.Weightfile.load(self.identifier) | |
Weightfile of the method. | |
general_options = basf2_mva.GeneralOptions() | |
General options of the method. | |
specific_options = None | |
Specific options of the method. | |
dict | importances = {k: importances[k] for k in variables} |
Dictionary of the variable importances calculated by the method. | |
variables = list(sorted(variables, key=lambda v: self.importances.get(v, 0.0))) | |
List of variables sorted by their importance. | |
list | root_variables = [ROOT.Belle2.MakeROOTCompatible.makeROOTCompatible(v) for v in self.variables] |
List of the variable importances calculated by the method, but with the root compatible variable names. | |
dict | root_importances = {k: importances[k] for k in self.root_variables} |
Dictionary of the variables sorted by their importance but with root compatoble variable names. | |
description = str(basf2_mva.info(self.identifier)) | |
Description of the method as a xml string returned by basf2_mva.info. | |
list | spectators = [str(v) for v in self.general_options.m_spectators] |
List of spectators. | |
list | root_spectators = [ROOT.Belle2.MakeROOTCompatible.makeROOTCompatible(v) for v in self.spectators] |
List of spectators with root compatible names. | |
Wrapper class providing an interface to the method stored under the given identifier. It loads the Options, can apply the expert and train new ones using the current as a prototype. This class is used by the basf_mva_evaluation tools
Definition at line 141 of file basf2_mva_util.py.
__init__ | ( | self, | |
identifier ) |
Load a method stored under the given identifier @param identifier identifying the method
Definition at line 148 of file basf2_mva_util.py.
apply_expert | ( | self, | |
datafiles, | |||
treename ) |
Apply the expert of the method to data and return the calculated probability and the target @param datafiles the datafiles @param treename the name of the tree containing the data
Definition at line 248 of file basf2_mva_util.py.
train_teacher | ( | self, | |
datafiles, | |||
treename, | |||
general_options = None, | |||
specific_options = None ) |
Train a new method using this method as a prototype @param datafiles the training datafiles @param treename the name of the tree containing the training data @param general_options general options given to basf2_mva.teacher (if None the options of this method are used) @param specific_options specific options given to basf2_mva.teacher (if None the options of this method are used)
Definition at line 218 of file basf2_mva_util.py.
description = str(basf2_mva.info(self.identifier)) |
Description of the method as a xml string returned by basf2_mva.info.
Definition at line 212 of file basf2_mva_util.py.
general_options = basf2_mva.GeneralOptions() |
General options of the method.
Definition at line 162 of file basf2_mva_util.py.
identifier = identifier |
Identifier of the method.
Definition at line 158 of file basf2_mva_util.py.
dict importances = {k: importances[k] for k in variables} |
Dictionary of the variable importances calculated by the method.
Definition at line 204 of file basf2_mva_util.py.
dict root_importances = {k: importances[k] for k in self.root_variables} |
Dictionary of the variables sorted by their importance but with root compatoble variable names.
Definition at line 210 of file basf2_mva_util.py.
list root_spectators = [ROOT.Belle2.MakeROOTCompatible.makeROOTCompatible(v) for v in self.spectators] |
List of spectators with root compatible names.
Definition at line 216 of file basf2_mva_util.py.
list root_variables = [ROOT.Belle2.MakeROOTCompatible.makeROOTCompatible(v) for v in self.variables] |
List of the variable importances calculated by the method, but with the root compatible variable names.
Definition at line 208 of file basf2_mva_util.py.
specific_options = None |
Specific options of the method.
Definition at line 176 of file basf2_mva_util.py.
list spectators = [str(v) for v in self.general_options.m_spectators] |
List of spectators.
Definition at line 214 of file basf2_mva_util.py.
variables = list(sorted(variables, key=lambda v: self.importances.get(v, 0.0))) |
List of variables sorted by their importance.
Definition at line 206 of file basf2_mva_util.py.
weightfile = ROOT.Belle2.MVA.Weightfile.load(self.identifier) |
Weightfile of the method.
Definition at line 160 of file basf2_mva_util.py.