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
224b8b98
Unverified
Commit
224b8b98
authored
Feb 24, 2020
by
Nikita Titov
Committed by
GitHub
Feb 24, 2020
Browse files
fixed cpplint issues (#2809)
* fixed cpplint issues * fixed cpplint issues
parent
414c7b44
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
src/boosting/gbdt.cpp
src/boosting/gbdt.cpp
+3
-3
src/c_api.cpp
src/c_api.cpp
+1
-1
No files found.
src/boosting/gbdt.cpp
View file @
224b8b98
...
@@ -49,7 +49,7 @@ void GBDT::Init(const Config* config, const Dataset* train_data, const Objective
...
@@ -49,7 +49,7 @@ void GBDT::Init(const Config* config, const Dataset* train_data, const Objective
train_data_
=
train_data
;
train_data_
=
train_data
;
if
(
!
config
->
monotone_constraints
.
empty
())
{
if
(
!
config
->
monotone_constraints
.
empty
())
{
CHECK
(
static_cast
<
size_t
>
(
train_data_
->
num_total_features
())
==
config
->
monotone_constraints
.
size
());
CHECK
(
static_cast
<
size_t
>
(
train_data_
->
num_total_features
())
==
config
->
monotone_constraints
.
size
());
}
}
if
(
!
config
->
feature_contri
.
empty
())
{
if
(
!
config
->
feature_contri
.
empty
())
{
CHECK
(
static_cast
<
size_t
>
(
train_data_
->
num_total_features
())
==
config
->
feature_contri
.
size
());
CHECK
(
static_cast
<
size_t
>
(
train_data_
->
num_total_features
())
==
config
->
feature_contri
.
size
());
}
}
...
@@ -671,7 +671,7 @@ void GBDT::GetPredictAt(int data_idx, double* out_result, int64_t* out_len) {
...
@@ -671,7 +671,7 @@ void GBDT::GetPredictAt(int data_idx, double* out_result, int64_t* out_len) {
double
GBDT
::
GetUpperBoundValue
()
const
{
double
GBDT
::
GetUpperBoundValue
()
const
{
double
max_value
=
0.0
;
double
max_value
=
0.0
;
for
(
const
auto
&
tree
:
models_
)
{
for
(
const
auto
&
tree
:
models_
)
{
max_value
+=
tree
->
GetUpperBoundValue
();
max_value
+=
tree
->
GetUpperBoundValue
();
}
}
return
max_value
;
return
max_value
;
...
@@ -679,7 +679,7 @@ double GBDT::GetUpperBoundValue() const {
...
@@ -679,7 +679,7 @@ double GBDT::GetUpperBoundValue() const {
double
GBDT
::
GetLowerBoundValue
()
const
{
double
GBDT
::
GetLowerBoundValue
()
const
{
double
min_value
=
0.0
;
double
min_value
=
0.0
;
for
(
const
auto
&
tree
:
models_
)
{
for
(
const
auto
&
tree
:
models_
)
{
min_value
+=
tree
->
GetLowerBoundValue
();
min_value
+=
tree
->
GetLowerBoundValue
();
}
}
return
min_value
;
return
min_value
;
...
...
src/c_api.cpp
View file @
224b8b98
...
@@ -1151,7 +1151,7 @@ int LGBM_DatasetGetField(DatasetHandle handle,
...
@@ -1151,7 +1151,7 @@ int LGBM_DatasetGetField(DatasetHandle handle,
}
else
if
(
dataset
->
GetDoubleField
(
field_name
,
out_len
,
reinterpret_cast
<
const
double
**>
(
out_ptr
)))
{
}
else
if
(
dataset
->
GetDoubleField
(
field_name
,
out_len
,
reinterpret_cast
<
const
double
**>
(
out_ptr
)))
{
*
out_type
=
C_API_DTYPE_FLOAT64
;
*
out_type
=
C_API_DTYPE_FLOAT64
;
is_success
=
true
;
is_success
=
true
;
}
}
if
(
!
is_success
)
{
throw
std
::
runtime_error
(
"Field not found"
);
}
if
(
!
is_success
)
{
throw
std
::
runtime_error
(
"Field not found"
);
}
if
(
*
out_ptr
==
nullptr
)
{
*
out_len
=
0
;
}
if
(
*
out_ptr
==
nullptr
)
{
*
out_len
=
0
;
}
API_END
();
API_END
();
...
...
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