add doc for Python wrapper

This commit is contained in:
Yizheng Liao 2015-04-26 22:08:06 -07:00
parent b5c8085638
commit bb91bdea84

View File

@ -124,3 +124,8 @@ data = np.random.rand(7,10) # 7 entities, each contains 10 features
dtest = xgb.DMatrix( data, missing = -999.0 ) dtest = xgb.DMatrix( data, missing = -999.0 )
ypred = bst.predict( xgmat ) ypred = bst.predict( xgmat )
``` ```
If early stopping is enabled during training, you can predict with the best iteration.
```python
ypred = bst.predict(xgmat,ntree_limit=bst.best_iteration)
```