You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found out that the ordinal softmax function yields an output of list which contains NUM_CLASSES - 1. In other words, it's a list. I have been wondering how to have the layer to give an output of the predicted class in an integer. I found some activation functions in the activations module: 1) coral_cumprobs and 2) cumprobs_to_label.
Correct me if I'm wrong. If my goal is to have a single integer of predicted class in the output. I could use both functions mentioned above in order. Hence, I tried to created a custom activation function, something like this
Particular to your question here, ordinal regression (not classification!) gives you estimates of the Pr(label > i). It is up to the decision maker -- you or your stakeholder -- to take those probabilities and turn them into a classification of the decision (label) you want to pick. There is no single best way to do that; it depends on the cost of making errors.
Now you could write a custom layer that turns ordinal probabilities into integers (e.g., ordinal probs -> softmax probs -> tf.argmax()), add it to the model you have, and then adapt the loss function / metric that works off labels (e.g., precision). However, as explained in the posts above, this is usually not recommended, as you combine prediction & classification in a single process, which makes it much harder to use in practice. It also makes it impossible to differentiate model predictive performance from the decision making process.
Hello.
I found out that the ordinal softmax function yields an output of list which contains NUM_CLASSES - 1. In other words, it's a list. I have been wondering how to have the layer to give an output of the predicted class in an integer. I found some activation functions in the activations module: 1) coral_cumprobs and 2) cumprobs_to_label.
Correct me if I'm wrong. If my goal is to have a single integer of predicted class in the output. I could use both functions mentioned above in order. Hence, I tried to created a custom activation function, something like this
However, the model summary still tells that the output layer is a list of (1, NUM_CLASSES - 1)
Could you help me on this?
The text was updated successfully, but these errors were encountered: