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
381bc122
Commit
381bc122
authored
Apr 18, 2018
by
Guolin Ke
Browse files
fix #1321
parent
e005cdb0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
2 deletions
+1
-2
src/io/config.cpp
src/io/config.cpp
+0
-2
src/objective/regression_objective.hpp
src/objective/regression_objective.hpp
+1
-0
No files found.
src/io/config.cpp
View file @
381bc122
...
@@ -340,7 +340,6 @@ void ObjectiveConfig::Set(const std::unordered_map<std::string, std::string>& pa
...
@@ -340,7 +340,6 @@ void ObjectiveConfig::Set(const std::unordered_map<std::string, std::string>& pa
GetDouble
(
params
,
"scale_pos_weight"
,
&
scale_pos_weight
);
GetDouble
(
params
,
"scale_pos_weight"
,
&
scale_pos_weight
);
CHECK
(
scale_pos_weight
>
0
);
CHECK
(
scale_pos_weight
>
0
);
GetDouble
(
params
,
"alpha"
,
&
alpha
);
GetDouble
(
params
,
"alpha"
,
&
alpha
);
CHECK
(
alpha
>
0
&&
alpha
<
1
);
GetBool
(
params
,
"reg_sqrt"
,
&
reg_sqrt
);
GetBool
(
params
,
"reg_sqrt"
,
&
reg_sqrt
);
GetDouble
(
params
,
"tweedie_variance_power"
,
&
tweedie_variance_power
);
GetDouble
(
params
,
"tweedie_variance_power"
,
&
tweedie_variance_power
);
CHECK
(
tweedie_variance_power
>=
1
&&
tweedie_variance_power
<
2
);
CHECK
(
tweedie_variance_power
>=
1
&&
tweedie_variance_power
<
2
);
...
@@ -367,7 +366,6 @@ void MetricConfig::Set(const std::unordered_map<std::string, std::string>& param
...
@@ -367,7 +366,6 @@ void MetricConfig::Set(const std::unordered_map<std::string, std::string>& param
GetInt
(
params
,
"num_class"
,
&
num_class
);
GetInt
(
params
,
"num_class"
,
&
num_class
);
CHECK
(
num_class
>
0
);
CHECK
(
num_class
>
0
);
GetDouble
(
params
,
"alpha"
,
&
alpha
);
GetDouble
(
params
,
"alpha"
,
&
alpha
);
CHECK
(
alpha
>
0
&&
alpha
<
1
);
GetDouble
(
params
,
"tweedie_variance_power"
,
&
tweedie_variance_power
);
GetDouble
(
params
,
"tweedie_variance_power"
,
&
tweedie_variance_power
);
CHECK
(
tweedie_variance_power
>=
1
&&
tweedie_variance_power
<
2
);
CHECK
(
tweedie_variance_power
>=
1
&&
tweedie_variance_power
<
2
);
std
::
string
tmp_str
=
""
;
std
::
string
tmp_str
=
""
;
...
...
src/objective/regression_objective.hpp
View file @
381bc122
...
@@ -446,6 +446,7 @@ class RegressionQuantileloss : public RegressionL2loss {
...
@@ -446,6 +446,7 @@ class RegressionQuantileloss : public RegressionL2loss {
public:
public:
explicit
RegressionQuantileloss
(
const
ObjectiveConfig
&
config
)
:
RegressionL2loss
(
config
)
{
explicit
RegressionQuantileloss
(
const
ObjectiveConfig
&
config
)
:
RegressionL2loss
(
config
)
{
alpha_
=
static_cast
<
score_t
>
(
config
.
alpha
);
alpha_
=
static_cast
<
score_t
>
(
config
.
alpha
);
CHECK
(
alpha_
>
0
&&
alpha_
<
1
);
}
}
explicit
RegressionQuantileloss
(
const
std
::
vector
<
std
::
string
>&
strs
)
:
RegressionL2loss
(
strs
)
{
explicit
RegressionQuantileloss
(
const
std
::
vector
<
std
::
string
>&
strs
)
:
RegressionL2loss
(
strs
)
{
...
...
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