small fix to the doc

This commit is contained in:
tqchen 2014-09-04 09:18:52 -07:00
parent da9c856701
commit 6c6d00261c
2 changed files with 22 additions and 13 deletions

View File

@ -2,4 +2,5 @@
python basic_walkthrough.py python basic_walkthrough.py
python custom_objective.py python custom_objective.py
python boost_from_prediction.py python boost_from_prediction.py
rm *~ *.model *.buffer python cross_validation.py
rm -rf *~ *.model *.buffer

View File

@ -296,6 +296,7 @@ class Booster:
evals: list of tuple (DMatrix, string) evals: list of tuple (DMatrix, string)
lists of items to be evaluated lists of items to be evaluated
it: int it: int
current iteration
feval: function feval: function
custom evaluation function custom evaluation function
Returns: Returns:
@ -326,7 +327,8 @@ class Booster:
output_margin: bool output_margin: bool
whether output raw margin value that is untransformed whether output raw margin value that is untransformed
ntree_limit: limit number of trees in prediction, default to 0, 0 means using all the trees ntree_limit: int
limit number of trees in prediction, default to 0, 0 means using all the trees
Returns: Returns:
numpy array of prediction numpy array of prediction
""" """
@ -408,12 +410,13 @@ def train(params, dtrain, num_boost_round = 10, evals = [], obj=None, feval=None
data to be trained data to be trained
num_boost_round: int num_boost_round: int
num of round to be boosted num of round to be boosted
evals: list watchlist: list of pairs (DMatrix, string)
list of items to be evaluated list of items to be evaluated during training, this allows user to watch performance on validation set
obj: function obj: function
cutomized objective function cutomized objective function
feval: function feval: function
cutomized evaluation function cutomized evaluation function
Returns: Booster model trained
""" """
bst = Booster(params, [dtrain]+[ d[0] for d in evals ] ) bst = Booster(params, [dtrain]+[ d[0] for d in evals ] )
for i in range(num_boost_round): for i in range(num_boost_round):
@ -487,15 +490,20 @@ def cv(params, dtrain, num_boost_round = 10, nfold=3, metrics=[], \
num_boost_round: int num_boost_round: int
num of round to be boosted num of round to be boosted
nfold: int nfold: int
folds to do cv number of folds to do cv
evals: list or metrics: list of strings
list of items to be evaluated evaluation metrics to be watched in cv
obj: custom objective function obj: function
feval: custom evaluation function custom objective function
fpreproc: preprocessing function that takes dtrain, dtest, feval: function
custom evaluation function
fpreproc: function
preprocessing function that takes dtrain, dtest,
param and return transformed version of dtrain, dtest, param param and return transformed version of dtrain, dtest, param
show_stdv: whether display standard deviation show_stdv: bool
seed: seed used to generate the folds whether display standard deviation
seed: int
seed used to generate the folds, this is passed to numpy.random.seed
Returns: list(string) of evaluation history Returns: list(string) of evaluation history
""" """