R: AUC from pROC package2019 Community Moderator ElectionGetting a low ROC AUC score but a high accuracyObtaining threshold values from a ROC curve3-class AUC calculation in R (pROC package)data.table vs dplyr: can one do something well the other can't or does poorly?Custom AUC in R with different thresholds and binary predictionsHow to calculate multi class classification AUC with labels?R error in calculating AUC value from pROC packageChange default arguments of ROC computation (pROC) in the RFE process (caret) - RHow to compute AUC with ROCR packagexgboost using the auc metric correctlyHow to detect overfitting in xgboost(from test-auc score)
What can I do if someone tampers with my SSH public key?
Are small insurances worth it?
When Central Limit Theorem breaks down
What does it take to become a wilderness skills guide as a business?
How can I portion out frozen cookie dough?
Will the concrete slab in a partially heated shed conduct a lot of heat to the unconditioned area?
Giving a career talk in my old university, how prominently should I tell students my salary?
How can I have x-axis ticks that show ticks scaled in powers of ten?
How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?
Can inspiration allow the Rogue to make a Sneak Attack?
Too soon for a plot twist?
If nine coins are tossed, what is the probability that the number of heads is even?
What do you call someone who likes to pick fights?
What is the oldest European royal house?
A vote on the Brexit backstop
Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?
Can the Witch Sight warlock invocation see through the Mirror Image spell?
Is divide-by-zero a security vulnerability?
How do you make a gun that shoots melee weapons and/or swords?
Rationale to prefer local variables over instance variables?
How do you use environments that have the same name within a single latex document?
Should we avoid writing fiction about historical events without extensive research?
I am the person who abides by rules but breaks the rules . Who am I
What is the orbit and expected lifetime of Crew Dragon trunk?
R: AUC from pROC package
2019 Community Moderator ElectionGetting a low ROC AUC score but a high accuracyObtaining threshold values from a ROC curve3-class AUC calculation in R (pROC package)data.table vs dplyr: can one do something well the other can't or does poorly?Custom AUC in R with different thresholds and binary predictionsHow to calculate multi class classification AUC with labels?R error in calculating AUC value from pROC packageChange default arguments of ROC computation (pROC) in the RFE process (caret) - RHow to compute AUC with ROCR packagexgboost using the auc metric correctlyHow to detect overfitting in xgboost(from test-auc score)
I recently came across pROC
package to get AUC
. In the help section, they give following example:
library("pROC")
data(aSAH)
auc(aSAH$outcome, aSAH$s100b)
In above, outcome
is a factor
whereas s100b
is numerical
.
My question is how does AUC
work in this case? What threshold does it apply for s100b
? Or it does not matter?
Edit 1
The above code results in AUC = 0.73
. How do I know which threshold value was chosen to get this value?
r machine-learning data-science roc auc
add a comment |
I recently came across pROC
package to get AUC
. In the help section, they give following example:
library("pROC")
data(aSAH)
auc(aSAH$outcome, aSAH$s100b)
In above, outcome
is a factor
whereas s100b
is numerical
.
My question is how does AUC
work in this case? What threshold does it apply for s100b
? Or it does not matter?
Edit 1
The above code results in AUC = 0.73
. How do I know which threshold value was chosen to get this value?
r machine-learning data-science roc auc
Per the docs: "When it is called with two vectors (response, predictor) or a formula (response~predictor) arguments, theroc
function is called and only the AUC is returned." I'm not sure what you mean by thresholds,auc
is calculated by default using all thresholds between 0 and 1. You can also check ?roc for details as well.
– zack
2 days ago
@zack thanks for your response. I have added more information. Basically, what determines the output of AUC.
– chintan s
2 days ago
1
You sound a little confused; as @zack says, AUC is calculated across all possible thresholds. Maybe my answer here would be helpful: Getting a low ROC AUC score but a high accuracy.
– desertnaut
2 days ago
add a comment |
I recently came across pROC
package to get AUC
. In the help section, they give following example:
library("pROC")
data(aSAH)
auc(aSAH$outcome, aSAH$s100b)
In above, outcome
is a factor
whereas s100b
is numerical
.
My question is how does AUC
work in this case? What threshold does it apply for s100b
? Or it does not matter?
Edit 1
The above code results in AUC = 0.73
. How do I know which threshold value was chosen to get this value?
r machine-learning data-science roc auc
I recently came across pROC
package to get AUC
. In the help section, they give following example:
library("pROC")
data(aSAH)
auc(aSAH$outcome, aSAH$s100b)
In above, outcome
is a factor
whereas s100b
is numerical
.
My question is how does AUC
work in this case? What threshold does it apply for s100b
? Or it does not matter?
Edit 1
The above code results in AUC = 0.73
. How do I know which threshold value was chosen to get this value?
r machine-learning data-science roc auc
r machine-learning data-science roc auc
edited 2 days ago
chintan s
asked 2 days ago
chintan schintan s
1,88092951
1,88092951
Per the docs: "When it is called with two vectors (response, predictor) or a formula (response~predictor) arguments, theroc
function is called and only the AUC is returned." I'm not sure what you mean by thresholds,auc
is calculated by default using all thresholds between 0 and 1. You can also check ?roc for details as well.
– zack
2 days ago
@zack thanks for your response. I have added more information. Basically, what determines the output of AUC.
– chintan s
2 days ago
1
You sound a little confused; as @zack says, AUC is calculated across all possible thresholds. Maybe my answer here would be helpful: Getting a low ROC AUC score but a high accuracy.
– desertnaut
2 days ago
add a comment |
Per the docs: "When it is called with two vectors (response, predictor) or a formula (response~predictor) arguments, theroc
function is called and only the AUC is returned." I'm not sure what you mean by thresholds,auc
is calculated by default using all thresholds between 0 and 1. You can also check ?roc for details as well.
– zack
2 days ago
@zack thanks for your response. I have added more information. Basically, what determines the output of AUC.
– chintan s
2 days ago
1
You sound a little confused; as @zack says, AUC is calculated across all possible thresholds. Maybe my answer here would be helpful: Getting a low ROC AUC score but a high accuracy.
– desertnaut
2 days ago
Per the docs: "When it is called with two vectors (response, predictor) or a formula (response~predictor) arguments, the
roc
function is called and only the AUC is returned." I'm not sure what you mean by thresholds, auc
is calculated by default using all thresholds between 0 and 1. You can also check ?roc for details as well.– zack
2 days ago
Per the docs: "When it is called with two vectors (response, predictor) or a formula (response~predictor) arguments, the
roc
function is called and only the AUC is returned." I'm not sure what you mean by thresholds, auc
is calculated by default using all thresholds between 0 and 1. You can also check ?roc for details as well.– zack
2 days ago
@zack thanks for your response. I have added more information. Basically, what determines the output of AUC.
– chintan s
2 days ago
@zack thanks for your response. I have added more information. Basically, what determines the output of AUC.
– chintan s
2 days ago
1
1
You sound a little confused; as @zack says, AUC is calculated across all possible thresholds. Maybe my answer here would be helpful: Getting a low ROC AUC score but a high accuracy.
– desertnaut
2 days ago
You sound a little confused; as @zack says, AUC is calculated across all possible thresholds. Maybe my answer here would be helpful: Getting a low ROC AUC score but a high accuracy.
– desertnaut
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
The AUC in the auc
function of pROC is the Area Under the ROC curve. Behind the scenes the function calls the roc
function first, and so what you did is equivalent to:
myroc <- roc(aSAH$outcome, aSAH$s100b)
auc(myroc)
The ROC curve is obtained by calculating sensitivity and specificity for all possible thresholds. You can visualize the curve with the plot
function, and the AUC is shown in grey:
plot(myroc, auc.polygon=TRUE)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fstackoverflow.com%2fquestions%2f55028009%2fr-auc-from-proc-package%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The AUC in the auc
function of pROC is the Area Under the ROC curve. Behind the scenes the function calls the roc
function first, and so what you did is equivalent to:
myroc <- roc(aSAH$outcome, aSAH$s100b)
auc(myroc)
The ROC curve is obtained by calculating sensitivity and specificity for all possible thresholds. You can visualize the curve with the plot
function, and the AUC is shown in grey:
plot(myroc, auc.polygon=TRUE)
add a comment |
The AUC in the auc
function of pROC is the Area Under the ROC curve. Behind the scenes the function calls the roc
function first, and so what you did is equivalent to:
myroc <- roc(aSAH$outcome, aSAH$s100b)
auc(myroc)
The ROC curve is obtained by calculating sensitivity and specificity for all possible thresholds. You can visualize the curve with the plot
function, and the AUC is shown in grey:
plot(myroc, auc.polygon=TRUE)
add a comment |
The AUC in the auc
function of pROC is the Area Under the ROC curve. Behind the scenes the function calls the roc
function first, and so what you did is equivalent to:
myroc <- roc(aSAH$outcome, aSAH$s100b)
auc(myroc)
The ROC curve is obtained by calculating sensitivity and specificity for all possible thresholds. You can visualize the curve with the plot
function, and the AUC is shown in grey:
plot(myroc, auc.polygon=TRUE)
The AUC in the auc
function of pROC is the Area Under the ROC curve. Behind the scenes the function calls the roc
function first, and so what you did is equivalent to:
myroc <- roc(aSAH$outcome, aSAH$s100b)
auc(myroc)
The ROC curve is obtained by calculating sensitivity and specificity for all possible thresholds. You can visualize the curve with the plot
function, and the AUC is shown in grey:
plot(myroc, auc.polygon=TRUE)
edited 2 days ago
answered 2 days ago
CalimoCalimo
4,42422348
4,42422348
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- 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.
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%2fstackoverflow.com%2fquestions%2f55028009%2fr-auc-from-proc-package%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
Per the docs: "When it is called with two vectors (response, predictor) or a formula (response~predictor) arguments, the
roc
function is called and only the AUC is returned." I'm not sure what you mean by thresholds,auc
is calculated by default using all thresholds between 0 and 1. You can also check ?roc for details as well.– zack
2 days ago
@zack thanks for your response. I have added more information. Basically, what determines the output of AUC.
– chintan s
2 days ago
1
You sound a little confused; as @zack says, AUC is calculated across all possible thresholds. Maybe my answer here would be helpful: Getting a low ROC AUC score but a high accuracy.
– desertnaut
2 days ago