You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/sasctl/utils/pyml2ds/connectors/ensembles/lgb.py
+5-12Lines changed: 5 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -9,39 +9,30 @@ class LightgbmTreeParser(TreeParser):
9
9
def_not_leaf(self):
10
10
return'split_feature'inself._node
11
11
12
-
13
12
def_get_var(self):
14
13
returnself._features[self._node['split_feature']]
15
14
16
-
17
15
def_go_left(self):
18
16
returnself._node['default_left']
19
17
20
-
21
18
def_go_right(self):
22
19
return (notself._node['default_left'])
23
20
24
-
25
21
def_left_node(self):
26
22
returnself._node['left_child']
27
23
28
-
29
24
def_right_node(self):
30
25
returnself._node['right_child']
31
26
32
-
33
27
def_missing_node(self):
34
28
returnNone
35
29
36
-
37
30
def_split_value(self):
38
31
returnself._node['threshold']
39
32
40
-
41
33
def_decision_type(self):
42
34
returnself._node['decision_type']
43
35
44
-
45
36
def_leaf_value(self):
46
37
returnself._node['leaf_value']
47
38
@@ -53,23 +44,25 @@ class LightgbmParser(EnsembleParser):
53
44
----------
54
45
booster : lightgbm.basic.Booster
55
46
Booster of lightgbm model.
47
+
56
48
"""
57
49
def__init__(self, booster):
58
50
super(LightgbmParser, self).__init__()
59
51
60
52
self._booster=booster
61
-
62
53
self._dump=booster.dump_model()
54
+
63
55
ifself._dump['objective'] !='binary sigmoid:1':
64
-
raiseException("Unfortunately only binary sigmoid objective function is supported right now. Your objective is %s. Please, open an issue at https://gitlab.sas.com/from-russia-with-love/lgb2sas."%self.dump['objective'])
56
+
raiseValueError("Only binary sigmoid objective function is "
0 commit comments