Why does the cost property of my ensemble model object revert to default when I changed the value?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 11 de Mzo. de 2019
Respondida: MathWorks Support Team
el 25 de Mzo. de 2019
I am training an ensemble of classification trees, and I want to specify a unique cost matrix because there are unequal classification costs.
I ran the 'fitcensemble' function with the 'Cost' name value pair argument. I set the cost matrix to [0 50; 5 0]. However, when I look at my resulting ensemble model returned by this function, the 'Cost' field has reverted to the default matrix [0 1; 1 0]. Why is this?
Respuesta aceptada
MathWorks Support Team
el 11 de Mzo. de 2019
See the documentation for 'fitcensemble':
And the following link about handling unequal misclassification costs:
There are two properties for ensemble models that are used to handle imbalanced data or unequal misclassification costs, 'Cost' and 'Prior'. 'Cost' describes the misclassification costs for each class, and 'Prior' describes the prior probability of each class.
In the description of the 'Cost' property, there is a note that says:
"'fitcensemble' uses 'Cost' to adjust the prior class probabilities specified in 'Prior'. Then, 'fitcensemble' uses the adjusted prior probabilities for training and resets the cost matrix to its default."
This is why the cost might revert to the default matrix, [0 1; 1 0], after fitting a model with a different specified cost. The 'Prior' property has been adjusted to train the model according to these new misclassification costs, and the 'Cost' field has returned to its default value.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Classification Ensembles en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!