Commit 7f94fd9c authored by wxchan's avatar wxchan Committed by Guolin Ke
Browse files

fix feature importance (#468)

parent edd618bf
...@@ -1653,6 +1653,7 @@ class Booster(object): ...@@ -1653,6 +1653,7 @@ class Booster(object):
def dfs(root): def dfs(root):
if "split_feature" in root: if "split_feature" in root:
if root['split_gain'] > 0:
if importance_type == 'split': if importance_type == 'split':
ret[root["split_feature"]] += 1 ret[root["split_feature"]] += 1
elif importance_type == 'gain': elif importance_type == 'gain':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment