Send default configuration from metric to objective. (#8760)

This commit is contained in:
Jiaming Yuan
2023-02-09 20:18:07 +08:00
committed by GitHub
parent 5f76edd296
commit 199c421d60
4 changed files with 62 additions and 7 deletions

View File

@@ -55,6 +55,11 @@ class ObjFunction : public Configurable {
/*! \return the default evaluation metric for the objective */
virtual const char* DefaultEvalMetric() const = 0;
/**
* \brief Return the configuration for the default metric.
*/
virtual Json DefaultMetricConfig() const { return Json{Null{}}; }
// the following functions are optional, most of time default implementation is good enough
/*!
* \brief transform prediction values, this is only called when Prediction is called