sklearn.metrics.label_ranking_loss?
sklearn.metrics.label_ranking_loss(y_true, y_score, *, sample_weight=None)
計算排名損失度量
根據標簽集的大小和不在標簽集中的標簽數給定y_score加權,計算出錯誤排列的標簽對的平均數量。
這類似于錯誤集的大小,但由相關標簽和不相關標簽的數量加權。等級損失為零時可獲得最佳性能。
在用戶指南中閱讀更多內容。
版本0.17中的新功能:函數label_ranking_loss
參數 | 說明 |
---|---|
y_true | array or sparse matrix, shape = [n_samples, n_labels] 真正的二進制標簽,采用二進制指示符格式。 |
y_score | array, shape = [n_samples, n_labels] 目標分數可以是正例類的概率估計值、置信度值或決策的非閾值度量(如某些分類器上的“decision_function”所返回)。 |
sample_weight | array-like of shape (n_samples,), default=None 樣本權重。 |
返回值 | 說明 |
---|---|
loss | float |
參考
1 Tsoumakas, G., Katakis, I., & Vlahavas, I. (2010). Mining multi-label data. In Data mining and knowledge discovery handbook (pp. 667-685). Springer US.