[doc] Clarification for feature importance. (#8151)

This commit is contained in:
Jiaming Yuan 2022-08-11 00:30:42 +08:00 committed by GitHub
parent 446d536c23
commit bdb291f1c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1259,8 +1259,12 @@ class XGBModel(XGBModelBase):
@property
def feature_importances_(self) -> np.ndarray:
"""
Feature importances property, return depends on `importance_type` parameter.
"""Feature importances property, return depends on `importance_type`
parameter. When model trained with multi-class/multi-label/multi-target dataset,
the feature importance is "averaged" over all targets. The "average" is defined
based on the importance type. For instance, if the importance type is
"total_gain", then the score is sum of loss change for each split from all
trees.
Returns
-------