Many users have asked about saving instance counts in XGBoost model (e.g. #3419). Since XGBoost uses binary dumps for model exchange, adding extra fields in TreeModel
or RTreeNodeStat
will break backward compatibility (i.e. users of older XGBoost versions won’t be able to open model files produced by newer versions of XGBoost). For details, see this line and this line.
Let’s come up with a way to save instance counts while preserving backward compatibility.