Model Evaluation

本文介绍了混淆矩阵的基本概念及其在二分类问题中的应用,并详细解释了基于混淆矩阵的各种评估指标,如准确率、真阳性率、真阴性率等。此外,还探讨了ROC曲线的应用场景及归一化加权均方根对数误差(NWRMSLE)的计算方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

1. Confusion Matrix

 

Fact\Predict Class A Class B
Class ATrue Positive False Negative
Class BFalse Positive  True Nagative

 

 

 

A confusion table for Class A

 

Positive/ Negative: if target class is A, then the predict A is Positve, Others are negative.

True (P/N): if Predict = Fact, then it's True.

 

2. Measures based on Confusion Matrix

 a. Accuracy = TN+TP/ALL

  comments: not good measure when data are unbalanced.

b. True Positive Rate/ recall/ sensitivity =  TP / TP + FN

  comments: use it when Positive results are important

c. True Negative Rate =  TN / TN + FP

  comments: use it when Negative Results are important

 

R for Confusion Matrix:

library(SDMTools)

confusion.matrix(svmmodel.truth,svmmodel.class)

 

3. ROC curve (bio-classification)

y: sensitivity

x: specificity

 

The bigger the Area of ROC is, the more accurate the model is.

 

4. Normalized Weighted Root Mean Squared Logarithmic Error

Submissions are evaluated on the Normalized Weighted Root Mean Squared Logarithmic Error (NWRMSLE), calculated as follows:

 

NWRMSLE=ni=1wi(ln(y^i+1)ln(yi+1))2ni=1wi−−−−−−−−−−−−−−−−−−−−−−−−−−−⎷NWRMSLE=∑i=1nwi(ln⁡(y^i+1)−ln⁡(yi+1))2∑i=1nwi

 

 

where for row i, y^iy^i is the predicted unit_sales of an item and yiyi is the actual unit_sales; n is the total number of rows in the test set.

The weights, wiwi, can be found in the items.csv file (see the Data page). Perishable items are given a weight of 1.25 where all other items are given a weight of 1.00.

This metric is suitable when predicting values across a large range of orders of magnitudes. It avoids penalizing large differences in prediction when both the predicted and the true number are large: predicting 5 when the true value is 50 is penalized more than predicting 500 when the true value is 545.

 

转载于:https://www.cnblogs.com/fuxiaotong/p/7189975.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值