ATLAS Offline Software
Public Member Functions | List of all members
util.convertXGBoostToRootTree.XBGoostTextNode Class Reference
Inheritance diagram for util.convertXGBoostToRootTree.XBGoostTextNode:
Collaboration diagram for util.convertXGBoostToRootTree.XBGoostTextNode:

Public Member Functions

def get_split_feature (self)
 
def get_value (self)
 
def get_left (self)
 
def get_right (self)
 
def get_nodeid (self, node_type)
 
def get_default_left (self)
 

Detailed Description

Adaptor from XGBoost dictionary to tree
   * XGboost Yes is < and No is >=

Definition at line 22 of file convertXGBoostToRootTree.py.

Member Function Documentation

◆ get_default_left()

def util.convertXGBoostToRootTree.XBGoostTextNode.get_default_left (   self)

Definition at line 57 of file convertXGBoostToRootTree.py.

57  def get_default_left(self):
58  if 'children' not in self:
59  return True
60  elif self.get_nodeid('yes') == self.get_nodeid('missing'):
61  return True
62  else:
63  return False
64 
65 

◆ get_left()

def util.convertXGBoostToRootTree.XBGoostTextNode.get_left (   self)

Definition at line 40 of file convertXGBoostToRootTree.py.

40  def get_left(self):
41  if 'children' not in self:
42  return None
43  else: # XGBoost "YES" is left branch in MVAUtils
44  return XBGoostTextNode(self['children'][self.get_nodeid('yes')])
45 

◆ get_nodeid()

def util.convertXGBoostToRootTree.XBGoostTextNode.get_nodeid (   self,
  node_type 
)

Definition at line 52 of file convertXGBoostToRootTree.py.

52  def get_nodeid(self, node_type):
53  for idx, children in enumerate(self['children']):
54  if children['nodeid'] == self[node_type]:
55  return idx
56 

◆ get_right()

def util.convertXGBoostToRootTree.XBGoostTextNode.get_right (   self)

Definition at line 46 of file convertXGBoostToRootTree.py.

46  def get_right(self):
47  if 'children' not in self:
48  return None
49  else: # XGBoost "NO" is right branch in MVAUtils
50  return XBGoostTextNode(self['children'][self.get_nodeid('no')])
51 

◆ get_split_feature()

def util.convertXGBoostToRootTree.XBGoostTextNode.get_split_feature (   self)

Definition at line 28 of file convertXGBoostToRootTree.py.

28  def get_split_feature(self):
29  if 'split' in self:
30  return self['split']
31  else:
32  return -1
33 

◆ get_value()

def util.convertXGBoostToRootTree.XBGoostTextNode.get_value (   self)

Definition at line 34 of file convertXGBoostToRootTree.py.

34  def get_value(self):
35  if 'split_condition' in self:
36  return self['split_condition']
37  else:
38  return self['leaf']
39 

The documentation for this class was generated from the following file: