xgboost/src/common/error_msg.h
Jiaming Yuan 08ce495b5d
Use Booster context in DMatrix. (#8896)
- Pass context from booster to DMatrix.
- Use context instead of integer for `n_threads`.
- Check the consistency configuration for `max_bin`.
- Test for all combinations of initialization options.
2023-04-28 21:47:14 +08:00

38 lines
1.1 KiB
C++

/**
* Copyright 2023 by XGBoost contributors
*
* \brief Common error message for various checks.
*/
#ifndef XGBOOST_COMMON_ERROR_MSG_H_
#define XGBOOST_COMMON_ERROR_MSG_H_
#include "xgboost/string_view.h" // for StringView
namespace xgboost::error {
constexpr StringView GroupWeight() {
return "Size of weight must equal to the number of query groups when ranking group is used.";
}
constexpr StringView GroupSize() {
return "Invalid query group structure. The number of rows obtained from group doesn't equal to ";
}
constexpr StringView LabelScoreSize() {
return "The size of label doesn't match the size of prediction.";
}
constexpr StringView InfInData() {
return "Input data contains `inf` or a value too large, while `missing` is not set to `inf`";
}
constexpr StringView NoF128() {
return "128-bit floating point is not supported on current platform.";
}
constexpr StringView InconsistentMaxBin() {
return "Inconsistent `max_bin`. `max_bin` should be the same across different QuantileDMatrix, "
"and consistent with the Booster being trained.";
}
} // namespace xgboost::error
#endif // XGBOOST_COMMON_ERROR_MSG_H_