"vscode:/vscode.git/clone" did not exist on "6f19edde528904ee3d61bdfa6fcf1e012a3ae2ed"
Unverified Commit 765ceadc authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

Improve warning wordings (#4731)

* Update dataset_loader.cpp

* Update dataset_loader.cpp

* Update dataset_loader.cpp
parent bc4e6686
...@@ -809,52 +809,58 @@ void DatasetLoader::CheckDataset(const Dataset* dataset, bool is_load_from_binar ...@@ -809,52 +809,58 @@ void DatasetLoader::CheckDataset(const Dataset* dataset, bool is_load_from_binar
if (is_load_from_binary) { if (is_load_from_binary) {
if (dataset->max_bin_ != config_.max_bin) { if (dataset->max_bin_ != config_.max_bin) {
Log::Fatal("Dataset max_bin %d != config %d", dataset->max_bin_, config_.max_bin); Log::Fatal("Dataset was constructed with parameter max_bin=%d. It cannot be changed to %d when loading from binary file.",
dataset->max_bin_, config_.max_bin);
} }
if (dataset->min_data_in_bin_ != config_.min_data_in_bin) { if (dataset->min_data_in_bin_ != config_.min_data_in_bin) {
Log::Fatal("Dataset min_data_in_bin %d != config %d", dataset->min_data_in_bin_, config_.min_data_in_bin); Log::Fatal("Dataset was constructed with parameter min_data_in_bin=%d. It cannot be changed to %d when loading from binary file.",
dataset->min_data_in_bin_, config_.min_data_in_bin);
} }
if (dataset->use_missing_ != config_.use_missing) { if (dataset->use_missing_ != config_.use_missing) {
Log::Fatal("Dataset use_missing %d != config %d", dataset->use_missing_, config_.use_missing); Log::Fatal("Dataset was constructed with parameter use_missing=%d. It cannot be changed to %d when loading from binary file.",
dataset->use_missing_, config_.use_missing);
} }
if (dataset->zero_as_missing_ != config_.zero_as_missing) { if (dataset->zero_as_missing_ != config_.zero_as_missing) {
Log::Fatal("Dataset zero_as_missing %d != config %d", dataset->zero_as_missing_, config_.zero_as_missing); Log::Fatal("Dataset was constructed with parameter zero_as_missing=%d. It cannot be changed to %d when loading from binary file.",
dataset->zero_as_missing_, config_.zero_as_missing);
} }
if (dataset->bin_construct_sample_cnt_ != config_.bin_construct_sample_cnt) { if (dataset->bin_construct_sample_cnt_ != config_.bin_construct_sample_cnt) {
Log::Fatal("Dataset bin_construct_sample_cnt %d != config %d", dataset->bin_construct_sample_cnt_, config_.bin_construct_sample_cnt); Log::Fatal("Dataset was constructed with parameter bin_construct_sample_cnt=%d. It cannot be changed to %d when loading from binary file.",
dataset->bin_construct_sample_cnt_, config_.bin_construct_sample_cnt);
} }
if ((dataset->max_bin_by_feature_.size() != config_.max_bin_by_feature.size()) || if ((dataset->max_bin_by_feature_.size() != config_.max_bin_by_feature.size()) ||
!std::equal(dataset->max_bin_by_feature_.begin(), dataset->max_bin_by_feature_.end(), !std::equal(dataset->max_bin_by_feature_.begin(), dataset->max_bin_by_feature_.end(),
config_.max_bin_by_feature.begin())) { config_.max_bin_by_feature.begin())) {
Log::Fatal("Dataset max_bin_by_feature does not match with config"); Log::Fatal("Parameter max_bin_by_feature cannot be changed when loading from binary file.");
} }
int label_idx = -1; int label_idx = -1;
if (Common::AtoiAndCheck(config_.label_column.c_str(), &label_idx)) { if (Common::AtoiAndCheck(config_.label_column.c_str(), &label_idx)) {
if (dataset->label_idx_ != label_idx) { if (dataset->label_idx_ != label_idx) {
Log::Fatal("Dataset label_idx %d != config %d", dataset->label_idx_, label_idx); Log::Fatal("Dataset was constructed with label index %d. It cannot be changed to %d when loading from binary file.",
dataset->label_idx_, label_idx);
} }
} else { } else {
Log::Info("Recommend use integer for label index when loading data from binary for sanity check."); Log::Info("It is recommended to use integer for label index when loading from binary file for sanity check.");
} }
if (config_.label_column != "") { if (config_.label_column != "") {
Log::Warning("Config label_column works only in case of loading data directly from text file. It will be ignored when loading from binary file."); Log::Warning("Parameter label_column works only in case of loading data directly from text file. It will be ignored when loading from binary file.");
} }
if (config_.weight_column != "") { if (config_.weight_column != "") {
Log::Warning("Config weight_column works only in case of loading data directly from text file. It will be ignored when loading from binary file."); Log::Warning("Parameter weight_column works only in case of loading data directly from text file. It will be ignored when loading from binary file.");
} }
if (config_.group_column != "") { if (config_.group_column != "") {
Log::Warning("Config group_column works only in case of loading data directly from text file. It will be ignored when loading from binary file."); Log::Warning("Parameter group_column works only in case of loading data directly from text file. It will be ignored when loading from binary file.");
} }
if (config_.ignore_column != "") { if (config_.ignore_column != "") {
Log::Warning("Config ignore_column works only in case of loading data directly from text file. It will be ignored when loading from binary file."); Log::Warning("Parameter ignore_column works only in case of loading data directly from text file. It will be ignored when loading from binary file.");
} }
if (config_.two_round) { if (config_.two_round) {
Log::Warning("Config two_round works only in case of loading data directly from text file. It will be ignored when loading from binary file."); Log::Warning("Parameter two_round works only in case of loading data directly from text file. It will be ignored when loading from binary file.");
} }
if (config_.header) { if (config_.header) {
Log::Warning("Config header works only in case of loading data directly from text file. It will be ignored when loading from binary file."); Log::Warning("Parameter header works only in case of loading data directly from text file. It will be ignored when loading from binary file.");
} }
} }
} }
......
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