Configuration for init estimation. (#8343)
* Configuration for init estimation. * Check whether the model needs configuration based on const attribute `ModelFitted` instead of a mutable state. * Add parameter `boost_from_average` to tell whether the user has specified base score. * Add tests.
This commit is contained in:
@@ -75,6 +75,11 @@ class GradientBooster : public Model, public Configurable {
|
||||
/*! \brief Return number of boosted rounds.
|
||||
*/
|
||||
virtual int32_t BoostedRounds() const = 0;
|
||||
/**
|
||||
* \brief Whether the model has already been trained. When tree booster is chosen, then
|
||||
* returns true when there are existing trees.
|
||||
*/
|
||||
virtual bool ModelFitted() const = 0;
|
||||
/*!
|
||||
* \brief perform update to the model(boosting)
|
||||
* \param p_fmat feature matrix that provide access to features
|
||||
|
||||
@@ -328,7 +328,7 @@ struct LearnerModelParam {
|
||||
void Copy(LearnerModelParam const& that);
|
||||
|
||||
/* \brief Whether this parameter is initialized with LearnerModelParamLegacy. */
|
||||
bool Initialized() const { return num_feature != 0; }
|
||||
bool Initialized() const { return num_feature != 0 && num_output_group != 0; }
|
||||
};
|
||||
|
||||
} // namespace xgboost
|
||||
|
||||
Reference in New Issue
Block a user