Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
922013b0
Commit
922013b0
authored
Apr 30, 2017
by
Peter
Committed by
Guolin Ke
Apr 30, 2017
Browse files
fix cv metrics bug (#476)
parent
8a19834a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
docs/Python-API.md
docs/Python-API.md
+2
-1
python-package/lightgbm/engine.py
python-package/lightgbm/engine.py
+3
-6
No files found.
docs/Python-API.md
View file @
922013b0
...
@@ -556,8 +556,9 @@ The methods of each Class is in alphabetical order.
...
@@ -556,8 +556,9 @@ The methods of each Class is in alphabetical order.
Perform stratified sampling.
Perform stratified sampling.
shuffle: bool
shuffle: bool
Whether shuffle before split data.
Whether shuffle before split data.
metrics : str or list of str
metrics : str or list of str
, default None
Evaluation metrics to be watched in CV.
Evaluation metrics to be watched in CV.
If `metrics` is not None, the metric in `params` will be overridden.
fobj : function
fobj : function
Custom objective function.
Custom objective function.
feval : function
feval : function
...
...
python-package/lightgbm/engine.py
View file @
922013b0
...
@@ -314,6 +314,7 @@ def cv(params, train_set, num_boost_round=10,
...
@@ -314,6 +314,7 @@ def cv(params, train_set, num_boost_round=10,
Whether shuffle before split data
Whether shuffle before split data
metrics : string or list of strings
metrics : string or list of strings
Evaluation metrics to be watched in CV.
Evaluation metrics to be watched in CV.
If `metrics` is not None, the metric in `params` will be overridden.
fobj : function
fobj : function
Custom objective function.
Custom objective function.
feval : function
feval : function
...
@@ -368,12 +369,8 @@ def cv(params, train_set, num_boost_round=10,
...
@@ -368,12 +369,8 @@ def cv(params, train_set, num_boost_round=10,
train_set
.
set_feature_name
(
feature_name
)
train_set
.
set_feature_name
(
feature_name
)
train_set
.
set_categorical_feature
(
categorical_feature
)
train_set
.
set_categorical_feature
(
categorical_feature
)
if
metrics
:
if
metrics
is
not
None
:
params
.
setdefault
(
'metric'
,
[])
params
[
'metric'
]
=
metrics
if
isinstance
(
metrics
,
string_type
):
params
[
'metric'
].
append
(
metrics
)
else
:
params
[
'metric'
].
extend
(
metrics
)
results
=
collections
.
defaultdict
(
list
)
results
=
collections
.
defaultdict
(
list
)
cvfolds
=
_make_n_folds
(
train_set
,
data_splitter
=
data_splitter
,
cvfolds
=
_make_n_folds
(
train_set
,
data_splitter
=
data_splitter
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment