我xgboost multi-class classifier用来预测一系列可能失败的事情。我想运行该预测,并报告分类器用probability > 75%. 但是,如果我使用xgb.predict_proba(),则数组中结果的总和为 1。因此,如果有很多事情可能会失败,那么它们在结果数组中的百分比都会很小。
查看predict_proba 代码,我可以看到数组在哪里标准化。但是我不知道如何防止这种情况。
最后,我认为我的代码看起来像这样(除了预先标准化的概率):
probas = xgb.predict_proba(single_element_dataframe)
for class_name in xgb.classes_:
class_index = np.where(xgb.classes_ == class_name)
proba = probas[0][class_index]
if proba > 0:
print(f"{class_name}: {proba}")
有任何想法吗?