Closed juliohm closed 4 years ago
An alternative approach to this breaking PR is to introduce a new name like MisclassificationLoss
with the behaviour above, and leave ZeroOneLoss
untouched. Please let me know which is the most interesting approach and I can keep working on it.
Replaced by #122
This is an attempt to generalise the
ZeroOneLoss
to multi-class problems. As described in the existing doc string, the loss is more general than just checking the sign of the product ofy
andyhat
. It is more general in the sense that we check an "agreement" betweeny
andyhat
and return either0
or1
, i.e. the misclassification indicator function.Overall, the conceptual changes in this PR consist of:
ZeroOneLoss
is now a subtype ofSupervisedLoss
as opposed to the more restrictiveMarginLoss
typeNumber
as before, and I will continue this PR to make it work with pair ofCategoricalValue
fromCategoricalArrays.jl
Could you please provide feedback in this breaking change? Do you agree that we could move this very specific (seldom used as the doc string says) loss to the "other" family of losses along with
CrossentropyLoss
andPoissonLoss
? In the future these "other" losses could be classified into more specific subtype of SupervisedLoss. For example,ZeroOneLoss
has a functionpsi(y, yhat)
that is simplypsi(y, yhat) = y == yhat
unlike the functionpsi(y, yhat) = y*yhat
for margin-based losses, and unlike the functionpsi(y, yhat) = y - yhat
for distance-based losses.I appreciate if you can take a look at this PR, and provide feedback quickly. We are writing a paper that depends on this, and it would be nice to use a stable version of LossFunctions.jl in the Manifest.toml for the accompanying scripts.