Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
9bb3b0d0
Commit
9bb3b0d0
authored
Jul 20, 2017
by
Guolin Ke
Browse files
[python] add get_leaf_output in Booster
parent
bd4c4066
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+9
-0
No files found.
python-package/lightgbm/basic.py
View file @
9bb3b0d0
...
...
@@ -1618,6 +1618,15 @@ class Booster(object):
num_iteration
=
self
.
best_iteration
return
predictor
.
predict
(
data
,
num_iteration
,
raw_score
,
pred_leaf
,
data_has_header
,
is_reshape
)
def
get_leaf_output
(
tree_id
,
leaf_id
):
ret
=
ctypes
.
c_double
(
0
)
_safe_call
(
_LIB
.
LGBM_BoosterGetLeafValue
(
self
.
handle
,
ctypes
.
c_int
(
tree_id
),
ctypes
.
c_int
(
leaf_id
),
ctypes
.
byref
(
ret
)))
return
ret
.
value
def
_to_predictor
(
self
,
pred_parameter
=
None
):
"""Convert to predictor"""
predictor
=
_InnerPredictor
(
booster_handle
=
self
.
handle
,
pred_parameter
=
pred_parameter
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment