ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | List of all members
util.convertLGBMToRootTree.LGBMTextNode Class Reference
Inheritance diagram for util.convertLGBMToRootTree.LGBMTextNode:
Collaboration diagram for util.convertLGBMToRootTree.LGBMTextNode:

Public Member Functions

def __init__ (self, structure, invert_as_tmva=False)
 
def get_split_feature (self)
 
def get_value (self)
 
def get_left (self)
 
def get_right (self)
 
def get_default_left (self)
 

Public Attributes

 invert_as_tmva
 

Private Member Functions

def _get_left (self)
 
def _get_right (self)
 

Detailed Description

Adaptor from LGBM dictionary to tree

Definition at line 47 of file convertLGBMToRootTree.py.

Constructor & Destructor Documentation

◆ __init__()

def util.convertLGBMToRootTree.LGBMTextNode.__init__ (   self,
  structure,
  invert_as_tmva = False 
)

Definition at line 52 of file convertLGBMToRootTree.py.

52  def __init__(self, structure, invert_as_tmva=False):
53  super(LGBMTextNode, self).__init__(structure)
54  self.invert_as_tmva = invert_as_tmva
55 

Member Function Documentation

◆ _get_left()

def util.convertLGBMToRootTree.LGBMTextNode._get_left (   self)
private

Definition at line 68 of file convertLGBMToRootTree.py.

68  def _get_left(self):
69  if "left_child" not in self:
70  return None
71  if self["decision_type"] == "<=":
72  return LGBMTextNode(self["left_child"])
73  else:
74  return LGBMTextNode(self["right_child"])
75 

◆ _get_right()

def util.convertLGBMToRootTree.LGBMTextNode._get_right (   self)
private

Definition at line 76 of file convertLGBMToRootTree.py.

76  def _get_right(self):
77  if "right_child" not in self:
78  return None
79  if self["decision_type"] == "<=":
80  return LGBMTextNode(self["right_child"])
81  else:
82  return LGBMTextNode(self["left_child"])
83 

◆ get_default_left()

def util.convertLGBMToRootTree.LGBMTextNode.get_default_left (   self)

Definition at line 96 of file convertLGBMToRootTree.py.

96  def get_default_left(self):
97  return self.get("default_left", True)
98 
99 

◆ get_left()

def util.convertLGBMToRootTree.LGBMTextNode.get_left (   self)

Definition at line 84 of file convertLGBMToRootTree.py.

84  def get_left(self):
85  if not self.invert_as_tmva:
86  return self._get_left()
87  else:
88  return self._get_right()
89 

◆ get_right()

def util.convertLGBMToRootTree.LGBMTextNode.get_right (   self)

Definition at line 90 of file convertLGBMToRootTree.py.

90  def get_right(self):
91  if not self.invert_as_tmva:
92  return self._get_right()
93  else:
94  return self._get_left()
95 

◆ get_split_feature()

def util.convertLGBMToRootTree.LGBMTextNode.get_split_feature (   self)

Definition at line 56 of file convertLGBMToRootTree.py.

56  def get_split_feature(self):
57  if "split_feature" in self:
58  return self["split_feature"]
59  else:
60  return -1
61 

◆ get_value()

def util.convertLGBMToRootTree.LGBMTextNode.get_value (   self)

Definition at line 62 of file convertLGBMToRootTree.py.

62  def get_value(self):
63  if "threshold" in self:
64  return self["threshold"]
65  else:
66  return self["leaf_value"]
67 

Member Data Documentation

◆ invert_as_tmva

util.convertLGBMToRootTree.LGBMTextNode.invert_as_tmva

Definition at line 54 of file convertLGBMToRootTree.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18