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
2e100eeb
"git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "672d0e52a1ec2dcdb6bc07f93c0fc3ec9fd900e0"
Commit
2e100eeb
authored
Jan 14, 2017
by
wxchan
Committed by
Guolin Ke
Jan 14, 2017
Browse files
not check metrics w/o eval set (#212)
parent
011fe024
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
python-package/lightgbm/sklearn.py
python-package/lightgbm/sklearn.py
+1
-1
src/io/config.cpp
src/io/config.cpp
+7
-5
No files found.
python-package/lightgbm/sklearn.py
View file @
2e100eeb
...
...
@@ -564,7 +564,7 @@ class LGBMClassifier(LGBMModel, LGBMClassifierBase):
if
self
.
n_classes
>
2
:
# Switch to using a multiclass objective in the underlying LGBM instance
self
.
objective
=
"multiclass"
if
eval_set
is
not
None
and
eval_metric
==
"binary_logloss"
:
if
eval_metric
==
"binary_logloss"
:
eval_metric
=
"multi_logloss"
if
eval_set
is
not
None
:
...
...
src/io/config.cpp
View file @
2e100eeb
...
...
@@ -147,11 +147,13 @@ void OverallConfig::CheckParamConflict() {
Log
::
Fatal
(
"Number of classes must be 1 for non-multiclass training"
);
}
}
for
(
std
::
string
metric_type
:
metric_types
)
{
bool
metric_type_multiclass
=
(
metric_type
==
std
::
string
(
"multi_logloss"
)
||
metric_type
==
std
::
string
(
"multi_error"
));
if
((
objective_type_multiclass
&&
!
metric_type_multiclass
)
||
(
!
objective_type_multiclass
&&
metric_type_multiclass
))
{
Log
::
Fatal
(
"Objective and metrics don't match"
);
if
(
boosting_config
.
is_provide_training_metric
||
!
io_config
.
valid_data_filenames
.
empty
())
{
for
(
std
::
string
metric_type
:
metric_types
)
{
bool
metric_type_multiclass
=
(
metric_type
==
std
::
string
(
"multi_logloss"
)
||
metric_type
==
std
::
string
(
"multi_error"
));
if
((
objective_type_multiclass
&&
!
metric_type_multiclass
)
||
(
!
objective_type_multiclass
&&
metric_type_multiclass
))
{
Log
::
Fatal
(
"Objective and metrics don't match"
);
}
}
}
...
...
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