Is there a way I can double the punishment when model mis-classing to a specific class?

Is there a way I can double the punishment when model mis-classing to a specific class?

Manage alerts

Loading saved threads...

EvilRoach · External communityPost link
External question — Data Science Stack Exchange Author: EvilRoach Original post: https://datascience.stackexchange.com/questions/114675 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. As the title I asked. For example: a model that predicts the probability of a stock price rising/falling. Let's say this is a triple-classification problem. If it predicts "RISING", while the truth is "NO CHANGE", I want to give it a normal loss result; If it predicts "RISING", but the truth is "FALLING" , I want to give it more loss result. How to get it?
Quote
Report
gaspar · External communityPost link
External answer — Data Science Stack Exchange Author: gaspar Original post: https://datascience.stackexchange.com/a/114676 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Yes, but it would be good for you to know the reason for mis-classing, usually the reason is that data are imbalanced, so you should look at targert class distribution. Depending on the model you can use some regularization technique or assign weights to the desired class, for example in sklearn with decision tree. # class 1 with weight 0, so clf only predicts class 0 clf = DecisionTreeClassifier(random_state=0, class_weight={0: 1, 1: 0}) https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External question — Data Science Stack Exchange Author: EvilRoach Source score (net votes, not local likes): 0 Original post: https://datascience.stackexchange.com/questions/114675 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. As the title I asked. For example: a model that predicts the probability of a stock price rising/falling. Let's say this is a triple-classification problem. If it predicts "RISING", while the truth is "NO CHANGE", I want to give it a normal loss result; If it predicts "RISING", but the truth is "FALLING" , I want to give it more loss result. How to get it?

Cancel quote

Checking account access…