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
7776cfea
Unverified
Commit
7776cfea
authored
Mar 05, 2020
by
James Lamb
Committed by
GitHub
Mar 05, 2020
Browse files
[ci] fixed cpplint warnings about braces (#2869)
* [ci] fixed cpplint warnings about braces * removed excess line
parent
c319474f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
15 deletions
+7
-15
include/LightGBM/tree.h
include/LightGBM/tree.h
+0
-2
src/io/file_io.cpp
src/io/file_io.cpp
+7
-13
No files found.
include/LightGBM/tree.h
View file @
7776cfea
...
@@ -134,7 +134,6 @@ class Tree {
...
@@ -134,7 +134,6 @@ class Tree {
inline
int
PredictLeafIndex
(
const
double
*
feature_values
)
const
;
inline
int
PredictLeafIndex
(
const
double
*
feature_values
)
const
;
inline
int
PredictLeafIndexByMap
(
const
std
::
unordered_map
<
int
,
double
>&
feature_values
)
const
;
inline
int
PredictLeafIndexByMap
(
const
std
::
unordered_map
<
int
,
double
>&
feature_values
)
const
;
inline
void
PredictContrib
(
const
double
*
feature_values
,
int
num_features
,
double
*
output
);
inline
void
PredictContrib
(
const
double
*
feature_values
,
int
num_features
,
double
*
output
);
/*! \brief Get Number of leaves*/
/*! \brief Get Number of leaves*/
...
@@ -151,7 +150,6 @@ class Tree {
...
@@ -151,7 +150,6 @@ class Tree {
/*! \brief Get the number of data points that fall at or below this node*/
/*! \brief Get the number of data points that fall at or below this node*/
inline
int
data_count
(
int
node
)
const
{
return
node
>=
0
?
internal_count_
[
node
]
:
leaf_count_
[
~
node
];
}
inline
int
data_count
(
int
node
)
const
{
return
node
>=
0
?
internal_count_
[
node
]
:
leaf_count_
[
~
node
];
}
/*!
/*!
* \brief Shrinkage for the tree's output
* \brief Shrinkage for the tree's output
* shrinkage rate (a.k.a learning rate) is used to tune the training process
* shrinkage rate (a.k.a learning rate) is used to tune the training process
...
...
src/io/file_io.cpp
View file @
7776cfea
...
@@ -170,11 +170,9 @@ std::unique_ptr<VirtualFileReader> VirtualFileReader::Make(
...
@@ -170,11 +170,9 @@ std::unique_ptr<VirtualFileReader> VirtualFileReader::Make(
if
(
0
==
filename
.
find
(
kHdfsProto
))
{
if
(
0
==
filename
.
find
(
kHdfsProto
))
{
WITH_HDFS
(
return
std
::
unique_ptr
<
VirtualFileReader
>
(
WITH_HDFS
(
return
std
::
unique_ptr
<
VirtualFileReader
>
(
new
HDFSFile
(
filename
,
O_RDONLY
)));
new
HDFSFile
(
filename
,
O_RDONLY
)));
}
else
#endif
{
return
std
::
unique_ptr
<
VirtualFileReader
>
(
new
LocalFile
(
filename
,
"rb"
));
}
}
#endif
return
std
::
unique_ptr
<
VirtualFileReader
>
(
new
LocalFile
(
filename
,
"rb"
));
}
}
std
::
unique_ptr
<
VirtualFileWriter
>
VirtualFileWriter
::
Make
(
std
::
unique_ptr
<
VirtualFileWriter
>
VirtualFileWriter
::
Make
(
...
@@ -183,23 +181,19 @@ std::unique_ptr<VirtualFileWriter> VirtualFileWriter::Make(
...
@@ -183,23 +181,19 @@ std::unique_ptr<VirtualFileWriter> VirtualFileWriter::Make(
if
(
0
==
filename
.
find
(
kHdfsProto
))
{
if
(
0
==
filename
.
find
(
kHdfsProto
))
{
WITH_HDFS
(
return
std
::
unique_ptr
<
VirtualFileWriter
>
(
WITH_HDFS
(
return
std
::
unique_ptr
<
VirtualFileWriter
>
(
new
HDFSFile
(
filename
,
O_WRONLY
)));
new
HDFSFile
(
filename
,
O_WRONLY
)));
}
else
#endif
{
return
std
::
unique_ptr
<
VirtualFileWriter
>
(
new
LocalFile
(
filename
,
"wb"
));
}
}
#endif
return
std
::
unique_ptr
<
VirtualFileWriter
>
(
new
LocalFile
(
filename
,
"wb"
));
}
}
bool
VirtualFileWriter
::
Exists
(
const
std
::
string
&
filename
)
{
bool
VirtualFileWriter
::
Exists
(
const
std
::
string
&
filename
)
{
#ifdef USE_HDFS
#ifdef USE_HDFS
if
(
0
==
filename
.
find
(
kHdfsProto
))
{
if
(
0
==
filename
.
find
(
kHdfsProto
))
{
WITH_HDFS
(
HDFSFile
file
(
filename
,
O_RDONLY
);
return
file
.
Exists
());
WITH_HDFS
(
HDFSFile
file
(
filename
,
O_RDONLY
);
return
file
.
Exists
());
}
else
#endif
{
LocalFile
file
(
filename
,
"rb"
);
return
file
.
Exists
();
}
}
#endif
LocalFile
file
(
filename
,
"rb"
);
return
file
.
Exists
();
}
}
}
// namespace LightGBM
}
// namespace LightGBM
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