How to configure cost matrix for MetaCost operator
Hello,
I am struggling with correctly setting up a cost matrix for the MetaCost operator. The documentation on it is quite sparse and even after reading many posts on this forum, I cannot find my answer. I also
Here is the cost matrix for the default tutorial process for the MetaCost operator (distinguishing mines from rocks in the Sonar dataset):
Class 1 is Rock; Class 2 is Mine.
That image refers to the Matlab cost matrix format (which I think is here:https://www.mathworks.com/help/stats/classification-with-unequal-misclassification-costs.html), but I still have many questions:
- I assume that the 2.0 and 3.0 are costs (penalties) for misclassification, since they are for wrong predictions. The Matlab instructions say that the true positive (TP) and true negative (TN) diagonal is supposed to be left at 0, but this does not make sense to me if I have benefits. Would they not be negative (opposite of costs) in that case?
Here is what I would think:
That is, with "yes" as the positive class:
- True positive: earns 45€, so cost is -45
- True negative: we spend nothing and gain nothing, so cost is 0
- False positive: we spent 5€ to call a customer but gained nothing, so cost is 5
- False negative: we spent nothing, but missed the opportunity of receiving 45€ profit, so cost is 45
So, I would appreciate clear guidance on how to correctly configure the cost matrix.
Regards,
Chitu
Tagged:
0

Maven
答案
Dortmund, Germany
- The documentation note "The cost matrix in Matlab single line format" is very confusing. When I looked up the Matlab documentation (https://www.mathworks.com/help/stats/classification-with-unequal-misclassification-costs.html), it explicitly says, "The diagonal elements C(i,i) of the cost matrix must be 0", which directly contradicts your very intuitive business matrix.
- Your business matrix express numbers positively as gains or benefits and costs as negative, but "cost matrix" implies that gains or benefits should be expressed negatively and costs positively. Which is it?
Thanks,Dortmund, Germany
<参数键= value =“except_value_type file_path"/>
<参数键= " maximal_depth”价值e="10"/>
Dortmund, Germany