Unverified Commit b857ee10 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

clarify no-meaningful-features warning in Dataset construction (fixes #5081) (#5083)

* clarify no-meaningful-features warning in Dataset construction (fixes #5081)

* update tests
parent d4cdbcfe
...@@ -333,8 +333,9 @@ void Dataset::Construct(std::vector<std::unique_ptr<BinMapper>>* bin_mappers, ...@@ -333,8 +333,9 @@ void Dataset::Construct(std::vector<std::unique_ptr<BinMapper>>* bin_mappers,
} }
if (used_features.empty()) { if (used_features.empty()) {
Log::Warning( Log::Warning(
"There are no meaningful features, as all feature values are " "There are no meaningful features which satisfy the provided configuration. "
"constant."); "Decreasing Dataset parameters min_data_in_bin or min_data_in_leaf and re-constructing "
"Dataset might resolve this warning.");
} }
auto features_in_group = NoGroup(used_features); auto features_in_group = NoGroup(used_features);
......
...@@ -43,7 +43,7 @@ def test_register_logger(tmp_path): ...@@ -43,7 +43,7 @@ def test_register_logger(tmp_path):
lgb.plot_metric(eval_records) lgb.plot_metric(eval_records)
expected_log = r""" expected_log = r"""
INFO | [LightGBM] [Warning] There are no meaningful features, as all feature values are constant. INFO | [LightGBM] [Warning] There are no meaningful features which satisfy the provided configuration. Decreasing Dataset parameters min_data_in_bin or min_data_in_leaf and re-constructing Dataset might resolve this warning.
INFO | [LightGBM] [Info] Number of positive: 2, number of negative: 2 INFO | [LightGBM] [Info] Number of positive: 2, number of negative: 2
INFO | [LightGBM] [Info] Total Bins 0 INFO | [LightGBM] [Info] Total Bins 0
INFO | [LightGBM] [Info] Number of data points in the train set: 4, number of used features: 0 INFO | [LightGBM] [Info] Number of data points in the train set: 4, number of used features: 0
......
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