When using XGBRegressor, it's possible to use the base_score
setting to set the initial prediction value for all data points. Typically that value would be set to the mean of the observed value in the training set.
Is it possible to achieve a similar thing using XGBClassifier, by specifying a value for every target class, when the objective
parameter is set to multi:softproba
?
E.g. computing the sum of each occurrence for each target class in the training set and normalizing by percentage of total would give us:
class pct_total
--------------------
blue 0.57
red 0.22
green 0.16
black 0.05
So that when beginning its first iteration, XGBClassifier would start with these per-class values for every data point, instead of simply starting with 1 / num_classes
for all classes.
Is it possible to achieve this?
source https://stackoverflow.com/questions/72013683/using-base-score-with-xgbclassifier-to-provide-initial-priors-for-each-target-cl
Comments
Post a Comment