Unverified Commit 27ec9e3b authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

fixed some cpplint issues (#2635)

parent 86ca4845
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
namespace LightGBM { namespace LightGBM {
const size_t kGbs = size_t(1024) * 1024 * 1024;
/*! /*!
* \brief Read text data from file * \brief Read text data from file
*/ */
...@@ -123,10 +125,8 @@ class TextReader { ...@@ -123,10 +125,8 @@ class TextReader {
size_t prev_bytes_read = bytes_read; size_t prev_bytes_read = bytes_read;
bytes_read += read_cnt; bytes_read += read_cnt;
if (prev_bytes_read / read_progress_interval_bytes_ < bytes_read / read_progress_interval_bytes_) if (prev_bytes_read / read_progress_interval_bytes_ < bytes_read / read_progress_interval_bytes_) {
{ Log::Debug("Read %.1f GBs from %s.", 1.0 * bytes_read / kGbs, filename_);
const size_t gbs = size_t(1024) * 1024 * 1024;
Log::Debug("Read %.1f GBs from %s.", 1.0 * bytes_read / gbs, filename_);
} }
return cnt; return cnt;
...@@ -284,10 +284,8 @@ class TextReader { ...@@ -284,10 +284,8 @@ class TextReader {
size_t prev_bytes_read = bytes_read; size_t prev_bytes_read = bytes_read;
bytes_read += read_cnt; bytes_read += read_cnt;
if (prev_bytes_read / read_progress_interval_bytes_ < bytes_read / read_progress_interval_bytes_) if (prev_bytes_read / read_progress_interval_bytes_ < bytes_read / read_progress_interval_bytes_) {
{ Log::Debug("Read %.1f GBs from %s.", 1.0 * bytes_read / kGbs, filename_);
const size_t gbs = size_t(1024) * 1024 * 1024;
Log::Debug("Read %.1f GBs from %s.", 1.0 * bytes_read / gbs, filename_);
} }
return cnt; return cnt;
......
...@@ -181,7 +181,7 @@ void Config::GetAucMuWeights() { ...@@ -181,7 +181,7 @@ void Config::GetAucMuWeights() {
} }
} }
} }
}; }
void Config::Set(const std::unordered_map<std::string, std::string>& params) { void Config::Set(const std::unordered_map<std::string, std::string>& params) {
// generate seeds by seed. // generate seeds by seed.
......
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information. * Licensed under the MIT License. See LICENSE file in the project root for license information.
*/ */
#include <LightGBM/application.h> #include <LightGBM/application.h>
#include "network/linkers.h"
#include <iostream> #include <iostream>
#include "network/linkers.h"
int main(int argc, char** argv) { int main(int argc, char** argv) {
bool success = false; bool success = false;
try { try {
...@@ -38,4 +39,4 @@ int main(int argc, char** argv) { ...@@ -38,4 +39,4 @@ int main(int argc, char** argv) {
exit(-1); exit(-1);
} }
} }
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <string> #include <string>
#include <cmath> #include <cmath>
#include <utility>
#include <vector> #include <vector>
namespace LightGBM { namespace LightGBM {
...@@ -180,7 +181,7 @@ class MultiSoftmaxLoglossMetric: public MulticlassMetric<MultiSoftmaxLoglossMetr ...@@ -180,7 +181,7 @@ class MultiSoftmaxLoglossMetric: public MulticlassMetric<MultiSoftmaxLoglossMetr
/*! \brief Auc-mu for multiclass task*/ /*! \brief Auc-mu for multiclass task*/
class AucMuMetric : public Metric { class AucMuMetric : public Metric {
public: public:
explicit AucMuMetric(const Config& config) : config_(config) { explicit AucMuMetric(const Config& config) : config_(config) {
num_class_ = config.num_class; num_class_ = config.num_class;
class_weights_ = config.auc_mu_weights_matrix; class_weights_ = config.auc_mu_weights_matrix;
...@@ -248,8 +249,7 @@ public: ...@@ -248,8 +249,7 @@ public:
// if scores are equal, put j class first // if scores are equal, put j class first
if (std::fabs(a.second - b.second) < kEpsilon) { if (std::fabs(a.second - b.second) < kEpsilon) {
return label_[a.first] > label_[b.first]; return label_[a.first] > label_[b.first];
} } else if (a.second < b.second) {
else if (a.second < b.second) {
return true; return true;
} else { } else {
return false; return false;
...@@ -293,7 +293,7 @@ public: ...@@ -293,7 +293,7 @@ public:
return std::vector<double>(1, ans); return std::vector<double>(1, ans);
} }
private: private:
/*! \brief Number of data*/ /*! \brief Number of data*/
data_size_t num_data_; data_size_t num_data_;
/*! \brief Pointer to label*/ /*! \brief Pointer to label*/
......
...@@ -156,7 +156,7 @@ class Linkers { ...@@ -156,7 +156,7 @@ class Linkers {
static void MpiAbortIfIsParallel(); static void MpiAbortIfIsParallel();
#endif #endif
private: private:
/*! \brief Rank of local machine */ /*! \brief Rank of local machine */
int rank_; int rank_;
/*! \brief Total number machines */ /*! \brief Total number machines */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment