LGB CV
LGB CV
lgb.cv(
params,
train_set,
num_boost_round=100,
folds=None,
nfold=5,
stratified=True,
shuffle=True,
metrics=None,
fobj=None,
feval=None,
init_model=None,
feature_name='auto',
categorical_feature='auto',
early_stopping_rounds=None,
fpreproc=None,
verbose_eval=None,
show_stdv=True,
seed=0,
callbacks=None,
eval_train_metric=False,
return_cvbooster=False,
Docstring:
Parameters
----------
params : dict
train_set : Dataset
folds : generator or iterator of (train_idx, test_idx) tuples, scikit-learn splitter object or None, optional (default=None)
If generator or iterator, it should yield the train and test indices for each fold.
(https://scikit-learn.org/stable/modules/classes.html#splitter-classes)
This argument has highest priority over other data split arguments.
train_data : Dataset
The value of the first order derivative (gradient) for each sample point.
The value of the second order derivative (Hessian) for each sample point.
For multi-class task, the preds is group by class_id first, then group by row_id.
If you want to get i-th row preds in j-th class, the access way is score[j * num_data + i]
and you should group grad and hess in this way as well.
train_data : Dataset
eval_name : string
eval_result : float
is_higher_better : bool
For binary task, the preds is probability of positive class (or margin in case of specified ``fobj``).
For multi-class task, the preds is group by class_id first, then group by row_id.
If you want to get i-th row preds in j-th class, the access way is preds[j * num_data + i].
Feature names.
If 'auto' and data is pandas DataFrame, data columns names are used.
If 'auto' and data is pandas DataFrame, pandas unordered categorical columns are used.
All values in categorical features should be less than int32 max value (2147483647).
Large values could be memory consuming. Consider using consecutive integers starting from zero.
to continue.
Requires at least one metric. If there's more than one, will check all of them.
To check only the first metric, set the ``first_metric_only`` parameter to ``True`` in ``params``.
Last entry in evaluation history is the one from the best iteration.
Results are not affected by this parameter, and always contain std.
The score of the metric is calculated again after each training step, so there is some impact on performance.
Returns
-------
eval_hist : dict
Evaluation history.
...}.
File: e:\anaconda\installation\lib\site-packages\lightgbm\engine.py
Type: function