Skip to content

Commit

Permalink
Assert in demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Aug 1, 2020
1 parent 6be44eb commit 9a85264
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions demo/guide-python/feature_weights.py
Expand Up @@ -12,8 +12,8 @@
def main(args):
rng = np.random.RandomState(1994)

kRows = 512
kCols = 64
kRows = 1000
kCols = 10

X = rng.randn(kRows, kCols)
y = rng.randn(kRows)
Expand All @@ -31,6 +31,7 @@ def main(args):
featue_map = bst.get_fscore()
# feature zero has 0 weight
assert featue_map.get('f0', None) is None
assert max(featue_map.values()) == featue_map.get('f9')

if args.plot:
xgboost.plot_importance(bst)
Expand Down

0 comments on commit 9a85264

Please sign in to comment.