Skip to content

Commit 48835c3

Browse files
yang-zhangtqchen
authored andcommitted
Update predict leaf indices (dmlc#2135)
* Updated sklearn_parallel.py for soon-to-be-deprecated modules * Updated predict_leaf_indices.py; Use python3 print() as other exmaples and removed unused module
1 parent a4bae1b commit 48835c3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/python
2-
import numpy as np
32
import xgboost as xgb
43

54
### load data in do training
@@ -12,9 +11,9 @@
1211

1312
print ('start testing predict the leaf indices')
1413
### predict using first 2 tree
15-
leafindex = bst.predict(dtest, ntree_limit=2, pred_leaf = True)
16-
print leafindex.shape
17-
print leafindex
14+
leafindex = bst.predict(dtest, ntree_limit=2, pred_leaf=True)
15+
print(leafindex.shape)
16+
print(leafindex)
1817
### predict all trees
1918
leafindex = bst.predict(dtest, pred_leaf = True)
20-
print leafindex.shape
19+
print(leafindex.shape)

0 commit comments

Comments
 (0)