R - ROC Curves/AUC Specificity vs 1-Specificity
I have created a few predictive models and I am in the process of evaluating them by looking at the ROC Curve and AUC.
Currently, I have Specificity on X axis, however, when I researched ROC Curves, I saw 1 - Specificity on the X axis.
What is the difference and which should I use to validate my predictive models?
If Specificity is on the X-Axis, do I still want to maximize the AUC (from experience the answer is yes but I want to confirm)?
Here is how I am plotting it:
> library(pROC)
> g <- roc(Setup ~ Probs, data = Data)
> plot(g)
> auc(g)
> ci.auc(g)
r data-science roc auc predictive
add a comment |
I have created a few predictive models and I am in the process of evaluating them by looking at the ROC Curve and AUC.
Currently, I have Specificity on X axis, however, when I researched ROC Curves, I saw 1 - Specificity on the X axis.
What is the difference and which should I use to validate my predictive models?
If Specificity is on the X-Axis, do I still want to maximize the AUC (from experience the answer is yes but I want to confirm)?
Here is how I am plotting it:
> library(pROC)
> g <- roc(Setup ~ Probs, data = Data)
> plot(g)
> auc(g)
> ci.auc(g)
r data-science roc auc predictive
Does your ROC curve move towards the top-left corner with better performance? That's the convention. If you have specificity on the x-axis I guess the top-right corner would show better performance, but the area under the curve should be equal either way.
– Marius
Nov 21 '18 at 23:58
@Marius I added an image of the RUC Curve. The curve moves towards the top right corner but the "peaks" approaches the top left (if that makes any sense).
– MhQ-6
Nov 22 '18 at 0:05
In other words, it looks like any other ROC graph that I found on google, where the curve starts at the bottom left and moves towards the top right and the peaks extends towards the top left. Literally like any ROC curve you will find using google, only difference is, I have specificity on the x axis. All the ones I found on google have 1-Specificity. Not sure what to make of it.
– MhQ-6
Nov 22 '18 at 0:07
add a comment |
I have created a few predictive models and I am in the process of evaluating them by looking at the ROC Curve and AUC.
Currently, I have Specificity on X axis, however, when I researched ROC Curves, I saw 1 - Specificity on the X axis.
What is the difference and which should I use to validate my predictive models?
If Specificity is on the X-Axis, do I still want to maximize the AUC (from experience the answer is yes but I want to confirm)?
Here is how I am plotting it:
> library(pROC)
> g <- roc(Setup ~ Probs, data = Data)
> plot(g)
> auc(g)
> ci.auc(g)
r data-science roc auc predictive
I have created a few predictive models and I am in the process of evaluating them by looking at the ROC Curve and AUC.
Currently, I have Specificity on X axis, however, when I researched ROC Curves, I saw 1 - Specificity on the X axis.
What is the difference and which should I use to validate my predictive models?
If Specificity is on the X-Axis, do I still want to maximize the AUC (from experience the answer is yes but I want to confirm)?
Here is how I am plotting it:
> library(pROC)
> g <- roc(Setup ~ Probs, data = Data)
> plot(g)
> auc(g)
> ci.auc(g)
r data-science roc auc predictive
r data-science roc auc predictive
edited Nov 22 '18 at 0:04
MhQ-6
asked Nov 21 '18 at 23:54
MhQ-6MhQ-6
255
255
Does your ROC curve move towards the top-left corner with better performance? That's the convention. If you have specificity on the x-axis I guess the top-right corner would show better performance, but the area under the curve should be equal either way.
– Marius
Nov 21 '18 at 23:58
@Marius I added an image of the RUC Curve. The curve moves towards the top right corner but the "peaks" approaches the top left (if that makes any sense).
– MhQ-6
Nov 22 '18 at 0:05
In other words, it looks like any other ROC graph that I found on google, where the curve starts at the bottom left and moves towards the top right and the peaks extends towards the top left. Literally like any ROC curve you will find using google, only difference is, I have specificity on the x axis. All the ones I found on google have 1-Specificity. Not sure what to make of it.
– MhQ-6
Nov 22 '18 at 0:07
add a comment |
Does your ROC curve move towards the top-left corner with better performance? That's the convention. If you have specificity on the x-axis I guess the top-right corner would show better performance, but the area under the curve should be equal either way.
– Marius
Nov 21 '18 at 23:58
@Marius I added an image of the RUC Curve. The curve moves towards the top right corner but the "peaks" approaches the top left (if that makes any sense).
– MhQ-6
Nov 22 '18 at 0:05
In other words, it looks like any other ROC graph that I found on google, where the curve starts at the bottom left and moves towards the top right and the peaks extends towards the top left. Literally like any ROC curve you will find using google, only difference is, I have specificity on the x axis. All the ones I found on google have 1-Specificity. Not sure what to make of it.
– MhQ-6
Nov 22 '18 at 0:07
Does your ROC curve move towards the top-left corner with better performance? That's the convention. If you have specificity on the x-axis I guess the top-right corner would show better performance, but the area under the curve should be equal either way.
– Marius
Nov 21 '18 at 23:58
Does your ROC curve move towards the top-left corner with better performance? That's the convention. If you have specificity on the x-axis I guess the top-right corner would show better performance, but the area under the curve should be equal either way.
– Marius
Nov 21 '18 at 23:58
@Marius I added an image of the RUC Curve. The curve moves towards the top right corner but the "peaks" approaches the top left (if that makes any sense).
– MhQ-6
Nov 22 '18 at 0:05
@Marius I added an image of the RUC Curve. The curve moves towards the top right corner but the "peaks" approaches the top left (if that makes any sense).
– MhQ-6
Nov 22 '18 at 0:05
In other words, it looks like any other ROC graph that I found on google, where the curve starts at the bottom left and moves towards the top right and the peaks extends towards the top left. Literally like any ROC curve you will find using google, only difference is, I have specificity on the x axis. All the ones I found on google have 1-Specificity. Not sure what to make of it.
– MhQ-6
Nov 22 '18 at 0:07
In other words, it looks like any other ROC graph that I found on google, where the curve starts at the bottom left and moves towards the top right and the peaks extends towards the top left. Literally like any ROC curve you will find using google, only difference is, I have specificity on the x axis. All the ones I found on google have 1-Specificity. Not sure what to make of it.
– MhQ-6
Nov 22 '18 at 0:07
add a comment |
1 Answer
1
active
oldest
votes
This is purely a labeling problem: note that the x axis goes decreasing from 1 to 0, which is exactly the same as plotting 1-specificity on an x axis increasing from 0 to 1.
I assume you are using the pROC package. This behavior is documented in the FAQ and you can set the legacy.axes
argument to TRUE to change the behavior if the default one bothers you.
plot(g, legacy.axes = TRUE)
Thank you for the response!
– MhQ-6
Nov 26 '18 at 15:12
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%2f53422077%2fr-roc-curves-auc-specificity-vs-1-specificity%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
This is purely a labeling problem: note that the x axis goes decreasing from 1 to 0, which is exactly the same as plotting 1-specificity on an x axis increasing from 0 to 1.
I assume you are using the pROC package. This behavior is documented in the FAQ and you can set the legacy.axes
argument to TRUE to change the behavior if the default one bothers you.
plot(g, legacy.axes = TRUE)
Thank you for the response!
– MhQ-6
Nov 26 '18 at 15:12
add a comment |
This is purely a labeling problem: note that the x axis goes decreasing from 1 to 0, which is exactly the same as plotting 1-specificity on an x axis increasing from 0 to 1.
I assume you are using the pROC package. This behavior is documented in the FAQ and you can set the legacy.axes
argument to TRUE to change the behavior if the default one bothers you.
plot(g, legacy.axes = TRUE)
Thank you for the response!
– MhQ-6
Nov 26 '18 at 15:12
add a comment |
This is purely a labeling problem: note that the x axis goes decreasing from 1 to 0, which is exactly the same as plotting 1-specificity on an x axis increasing from 0 to 1.
I assume you are using the pROC package. This behavior is documented in the FAQ and you can set the legacy.axes
argument to TRUE to change the behavior if the default one bothers you.
plot(g, legacy.axes = TRUE)
This is purely a labeling problem: note that the x axis goes decreasing from 1 to 0, which is exactly the same as plotting 1-specificity on an x axis increasing from 0 to 1.
I assume you are using the pROC package. This behavior is documented in the FAQ and you can set the legacy.axes
argument to TRUE to change the behavior if the default one bothers you.
plot(g, legacy.axes = TRUE)
answered Nov 22 '18 at 7:57
CalimoCalimo
4,35422248
4,35422248
Thank you for the response!
– MhQ-6
Nov 26 '18 at 15:12
add a comment |
Thank you for the response!
– MhQ-6
Nov 26 '18 at 15:12
Thank you for the response!
– MhQ-6
Nov 26 '18 at 15:12
Thank you for the response!
– MhQ-6
Nov 26 '18 at 15:12
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%2f53422077%2fr-roc-curves-auc-specificity-vs-1-specificity%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
Does your ROC curve move towards the top-left corner with better performance? That's the convention. If you have specificity on the x-axis I guess the top-right corner would show better performance, but the area under the curve should be equal either way.
– Marius
Nov 21 '18 at 23:58
@Marius I added an image of the RUC Curve. The curve moves towards the top right corner but the "peaks" approaches the top left (if that makes any sense).
– MhQ-6
Nov 22 '18 at 0:05
In other words, it looks like any other ROC graph that I found on google, where the curve starts at the bottom left and moves towards the top right and the peaks extends towards the top left. Literally like any ROC curve you will find using google, only difference is, I have specificity on the x axis. All the ones I found on google have 1-Specificity. Not sure what to make of it.
– MhQ-6
Nov 22 '18 at 0:07