Commit 11c78526 authored by Laurae's avatar Laurae Committed by Qiwei Ye
Browse files

Python CV should be stratified by default (#734)

parent a3c63ff7
...@@ -232,7 +232,7 @@ class CVBooster(object): ...@@ -232,7 +232,7 @@ class CVBooster(object):
return handlerFunction return handlerFunction
def _make_n_folds(full_data, folds, nfold, params, seed, fpreproc=None, stratified=False, shuffle=True): def _make_n_folds(full_data, folds, nfold, params, seed, fpreproc=None, stratified=True, shuffle=True):
""" """
Make an n-fold list of Booster from random indices. Make an n-fold list of Booster from random indices.
""" """
...@@ -294,7 +294,7 @@ def _agg_cv_result(raw_results): ...@@ -294,7 +294,7 @@ def _agg_cv_result(raw_results):
def cv(params, train_set, num_boost_round=10, def cv(params, train_set, num_boost_round=10,
folds=None, nfold=5, stratified=False, shuffle=True, folds=None, nfold=5, stratified=True, shuffle=True,
metrics=None, fobj=None, feval=None, init_model=None, metrics=None, fobj=None, feval=None, init_model=None,
feature_name='auto', categorical_feature='auto', feature_name='auto', categorical_feature='auto',
early_stopping_rounds=None, fpreproc=None, early_stopping_rounds=None, fpreproc=None,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment