Can an output class be defaulted? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election Resultshow to make new class from the test dataMulti-class neural net always predicting 1 class after optimizationHow can we model the class which maximizes the event probability?Predict class having only class proportions for every attribute (non labeled data)Is it bad practice to use multi-class over multi-label classification?Binary classificaiton for weather data if its class 1 or class 0 alertMulti-Class Neural Networks | different featuresBalancing XGboost still skews towards the majority classHow to approach a machine learning problem?Multi-class classification as a hypothesis testing problem
How to calculate density of unknown planet?
Married in secret, can marital status in passport be changed at a later date?
Can gravitational waves pass through a black hole?
Who can become a wight?
Will I be more secure with my own router behind my ISP's router?
Why not use the yoke to control yaw, as well as pitch and roll?
Putting Ant-Man on house arrest
How is an IPA symbol that lacks a name (e.g. ɲ) called?
Does the Pact of the Blade warlock feature allow me to customize the properties of the pact weapon I create?
Why these surprising proportionalities of integrals involving odd zeta values?
Checking IFI enabled on SQL server below 2016
Etymology of 見舞い
Has a Nobel Peace laureate ever been accused of war crimes?
Suing a Police Officer Instead of the Police Department
enable https on private network
Does Prince Arnaud cause someone holding the Princess to lose?
Why aren't road bike wheels tiny?
Can I ask an author to send me his ebook?
"Destructive force" carried by a B-52?
Why did Israel vote against lifting the American embargo on Cuba?
Why aren't these two solutions equivalent? Combinatorics problem
Coin Game with infinite paradox
Providing direct feedback to a product salesperson
How to keep bees out of canned beverages?
Can an output class be defaulted?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election Resultshow to make new class from the test dataMulti-class neural net always predicting 1 class after optimizationHow can we model the class which maximizes the event probability?Predict class having only class proportions for every attribute (non labeled data)Is it bad practice to use multi-class over multi-label classification?Binary classificaiton for weather data if its class 1 or class 0 alertMulti-Class Neural Networks | different featuresBalancing XGboost still skews towards the majority classHow to approach a machine learning problem?Multi-class classification as a hypothesis testing problem
$begingroup$
In my use-case of multi-class classification, my data distribution is like below:
It might be too silly to ask this (and possibly could be gravely wrong), but is there a provision to default an o/p class to a value which is safe to be defaulted than to be predicted a completely wrong outcome.
Ex. Suppose the case, where an incoming email meant to be for "hardware" department but is predicted as for "Company Leadership" department and hence routed to all senior members of the company. In such case, since the prediction accuracy of the entire output class is below say 20% accuracy, I would like to default that entire class to "service desk" group and let them manually sort it.
Hope I made my question clear (Might be confusing as well!). Please let me know if any clarifications required. I would be happy to amend the wordings.
Thanks. :)
classification predictive-modeling multilabel-classification
$endgroup$
add a comment |
$begingroup$
In my use-case of multi-class classification, my data distribution is like below:
It might be too silly to ask this (and possibly could be gravely wrong), but is there a provision to default an o/p class to a value which is safe to be defaulted than to be predicted a completely wrong outcome.
Ex. Suppose the case, where an incoming email meant to be for "hardware" department but is predicted as for "Company Leadership" department and hence routed to all senior members of the company. In such case, since the prediction accuracy of the entire output class is below say 20% accuracy, I would like to default that entire class to "service desk" group and let them manually sort it.
Hope I made my question clear (Might be confusing as well!). Please let me know if any clarifications required. I would be happy to amend the wordings.
Thanks. :)
classification predictive-modeling multilabel-classification
$endgroup$
add a comment |
$begingroup$
In my use-case of multi-class classification, my data distribution is like below:
It might be too silly to ask this (and possibly could be gravely wrong), but is there a provision to default an o/p class to a value which is safe to be defaulted than to be predicted a completely wrong outcome.
Ex. Suppose the case, where an incoming email meant to be for "hardware" department but is predicted as for "Company Leadership" department and hence routed to all senior members of the company. In such case, since the prediction accuracy of the entire output class is below say 20% accuracy, I would like to default that entire class to "service desk" group and let them manually sort it.
Hope I made my question clear (Might be confusing as well!). Please let me know if any clarifications required. I would be happy to amend the wordings.
Thanks. :)
classification predictive-modeling multilabel-classification
$endgroup$
In my use-case of multi-class classification, my data distribution is like below:
It might be too silly to ask this (and possibly could be gravely wrong), but is there a provision to default an o/p class to a value which is safe to be defaulted than to be predicted a completely wrong outcome.
Ex. Suppose the case, where an incoming email meant to be for "hardware" department but is predicted as for "Company Leadership" department and hence routed to all senior members of the company. In such case, since the prediction accuracy of the entire output class is below say 20% accuracy, I would like to default that entire class to "service desk" group and let them manually sort it.
Hope I made my question clear (Might be confusing as well!). Please let me know if any clarifications required. I would be happy to amend the wordings.
Thanks. :)
classification predictive-modeling multilabel-classification
classification predictive-modeling multilabel-classification
asked Apr 5 at 16:30
ranit.branit.b
808
808
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
I don't think there is a standard method to do this. But if you use a probabilistic model you can use the predicted probability together with thresholds on each class to only allow classifications that you deem certain enough. Then if the class with the highest probability does not meet the threshold you can set it to the default class.
I tested it out with sklearn and numpy, this could be an approach:
# Train probabilistic classifier
clf.fit(X_train, y_train)
# Get probabilities
probas = clf.predict_proba(X_test)
# Get the class with highest probability
highest_proba_class = np.argmax(probas, axis=1)
# Set different thresholds per class
thresholds = np.array([0.9, 0.2, 0.5])
# Init our prediction array
predictions = np.zeros_like(highest_proba_class)
# Set a default class to set if we don't reach threshold
default_class = 2
# Loop over predictions
for idx, highest_class in enumerate(highest_proba_class):
# Threshold check if threshold was met, otherwise set default
if probas[idx][highest_class] >= thresholds[highest_class]:
predictions[idx] = highest_class
else:
predictions[idx] = default_class
$endgroup$
add a comment |
$begingroup$
There is a interesting module in scikitlearn in python which can help you a lot for what you are trying to do:
Dummy Classifiers in scikitlearn
Is very easy to use and you can select different methods.
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "557"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48702%2fcan-an-output-class-be-defaulted%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
I don't think there is a standard method to do this. But if you use a probabilistic model you can use the predicted probability together with thresholds on each class to only allow classifications that you deem certain enough. Then if the class with the highest probability does not meet the threshold you can set it to the default class.
I tested it out with sklearn and numpy, this could be an approach:
# Train probabilistic classifier
clf.fit(X_train, y_train)
# Get probabilities
probas = clf.predict_proba(X_test)
# Get the class with highest probability
highest_proba_class = np.argmax(probas, axis=1)
# Set different thresholds per class
thresholds = np.array([0.9, 0.2, 0.5])
# Init our prediction array
predictions = np.zeros_like(highest_proba_class)
# Set a default class to set if we don't reach threshold
default_class = 2
# Loop over predictions
for idx, highest_class in enumerate(highest_proba_class):
# Threshold check if threshold was met, otherwise set default
if probas[idx][highest_class] >= thresholds[highest_class]:
predictions[idx] = highest_class
else:
predictions[idx] = default_class
$endgroup$
add a comment |
$begingroup$
I don't think there is a standard method to do this. But if you use a probabilistic model you can use the predicted probability together with thresholds on each class to only allow classifications that you deem certain enough. Then if the class with the highest probability does not meet the threshold you can set it to the default class.
I tested it out with sklearn and numpy, this could be an approach:
# Train probabilistic classifier
clf.fit(X_train, y_train)
# Get probabilities
probas = clf.predict_proba(X_test)
# Get the class with highest probability
highest_proba_class = np.argmax(probas, axis=1)
# Set different thresholds per class
thresholds = np.array([0.9, 0.2, 0.5])
# Init our prediction array
predictions = np.zeros_like(highest_proba_class)
# Set a default class to set if we don't reach threshold
default_class = 2
# Loop over predictions
for idx, highest_class in enumerate(highest_proba_class):
# Threshold check if threshold was met, otherwise set default
if probas[idx][highest_class] >= thresholds[highest_class]:
predictions[idx] = highest_class
else:
predictions[idx] = default_class
$endgroup$
add a comment |
$begingroup$
I don't think there is a standard method to do this. But if you use a probabilistic model you can use the predicted probability together with thresholds on each class to only allow classifications that you deem certain enough. Then if the class with the highest probability does not meet the threshold you can set it to the default class.
I tested it out with sklearn and numpy, this could be an approach:
# Train probabilistic classifier
clf.fit(X_train, y_train)
# Get probabilities
probas = clf.predict_proba(X_test)
# Get the class with highest probability
highest_proba_class = np.argmax(probas, axis=1)
# Set different thresholds per class
thresholds = np.array([0.9, 0.2, 0.5])
# Init our prediction array
predictions = np.zeros_like(highest_proba_class)
# Set a default class to set if we don't reach threshold
default_class = 2
# Loop over predictions
for idx, highest_class in enumerate(highest_proba_class):
# Threshold check if threshold was met, otherwise set default
if probas[idx][highest_class] >= thresholds[highest_class]:
predictions[idx] = highest_class
else:
predictions[idx] = default_class
$endgroup$
I don't think there is a standard method to do this. But if you use a probabilistic model you can use the predicted probability together with thresholds on each class to only allow classifications that you deem certain enough. Then if the class with the highest probability does not meet the threshold you can set it to the default class.
I tested it out with sklearn and numpy, this could be an approach:
# Train probabilistic classifier
clf.fit(X_train, y_train)
# Get probabilities
probas = clf.predict_proba(X_test)
# Get the class with highest probability
highest_proba_class = np.argmax(probas, axis=1)
# Set different thresholds per class
thresholds = np.array([0.9, 0.2, 0.5])
# Init our prediction array
predictions = np.zeros_like(highest_proba_class)
# Set a default class to set if we don't reach threshold
default_class = 2
# Loop over predictions
for idx, highest_class in enumerate(highest_proba_class):
# Threshold check if threshold was met, otherwise set default
if probas[idx][highest_class] >= thresholds[highest_class]:
predictions[idx] = highest_class
else:
predictions[idx] = default_class
edited Apr 5 at 20:57
answered Apr 5 at 17:20
Simon LarssonSimon Larsson
1,110215
1,110215
add a comment |
add a comment |
$begingroup$
There is a interesting module in scikitlearn in python which can help you a lot for what you are trying to do:
Dummy Classifiers in scikitlearn
Is very easy to use and you can select different methods.
$endgroup$
add a comment |
$begingroup$
There is a interesting module in scikitlearn in python which can help you a lot for what you are trying to do:
Dummy Classifiers in scikitlearn
Is very easy to use and you can select different methods.
$endgroup$
add a comment |
$begingroup$
There is a interesting module in scikitlearn in python which can help you a lot for what you are trying to do:
Dummy Classifiers in scikitlearn
Is very easy to use and you can select different methods.
$endgroup$
There is a interesting module in scikitlearn in python which can help you a lot for what you are trying to do:
Dummy Classifiers in scikitlearn
Is very easy to use and you can select different methods.
answered Apr 12 at 17:36
Juan Esteban de la CalleJuan Esteban de la Calle
58918
58918
add a comment |
add a comment |
Thanks for contributing an answer to Data Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48702%2fcan-an-output-class-be-defaulted%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown