Comments (1)
@marftabucks I think it's useful to review prediction vs classification. For example, have a look at
https://stats.stackexchange.com/questions/464636/proper-scoring-rule-when-there-is-a-decision-to-make-e-g-spam-vs-ham-email/538442?noredirect=1#comment1107477_538442
or
https://www.fharrell.com/post/classification/
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.
See in particular the https://github.com/ck37/coral-ordinal/blob/master/coral_ordinal/activations.py , with all the helper functions that turn CORN/CORAL probabilities into softmax and labels.
from coral-ordinal.
Related Issues (19)
- AttributeError: module 'tensorflow.python.ops' has no attribute 'convert_to_tensor_v2' HOT 5
- MeanAbsoluteErrorLabels metric causes TypeError Exception HOT 3
- OrdinalCrossEntropy should not require `num_classes`; can be inferred from `y_pred`
- OrdinalCrossEntropy does not use `reduction` argument
- Implement CORN loss for logit outputs
- Add option to pass kernel_* and bias_* regularizers to Coral layer HOT 3
- Drop 'units' from get_config() in CornLayer to enable serialization
- Can you provide an example for functional API? HOT 2
- Turning a multi-class classification into ordinal regression HOT 2
- coral-ordinal consistently predicts only 0 in classification task
- Using corn loss with existing ordinal regression task.
- Class weights and coral.OrdinalCrossEntropy()
- InvalidArgumentError: Dimension -1 must be >=0
- Unsupported upperand error when using OrdinalCrossEntropy HOT 4
- bug in Colab notebook's MNIST example HOT 1
- Usage for segmentation HOT 1
- What is the recommended way to handle imbalanced data? HOT 1
- Loss function pug HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coral-ordinal.