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 48 of file convertLGBMToRootTree.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 53 of file convertLGBMToRootTree.py.

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

Member Function Documentation

◆ _get_left()

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

Definition at line 69 of file convertLGBMToRootTree.py.

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

◆ _get_right()

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

Definition at line 77 of file convertLGBMToRootTree.py.

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

◆ get_default_left()

def util.convertLGBMToRootTree.LGBMTextNode.get_default_left (   self)

Definition at line 97 of file convertLGBMToRootTree.py.

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

◆ get_left()

def util.convertLGBMToRootTree.LGBMTextNode.get_left (   self)

Definition at line 85 of file convertLGBMToRootTree.py.

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

◆ get_right()

def util.convertLGBMToRootTree.LGBMTextNode.get_right (   self)

Definition at line 91 of file convertLGBMToRootTree.py.

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

◆ get_split_feature()

def util.convertLGBMToRootTree.LGBMTextNode.get_split_feature (   self)

Definition at line 57 of file convertLGBMToRootTree.py.

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

◆ get_value()

def util.convertLGBMToRootTree.LGBMTextNode.get_value (   self)

Definition at line 63 of file convertLGBMToRootTree.py.

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

Member Data Documentation

◆ invert_as_tmva

util.convertLGBMToRootTree.LGBMTextNode.invert_as_tmva

Definition at line 55 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