R - ROC Curves/AUC Specificity vs 1-Specificity












0















enter image description hereI 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)









share|improve this question

























  • 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
















0















enter image description hereI 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)









share|improve this question

























  • 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














0












0








0








enter image description hereI 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)









share|improve this question
















enter image description hereI 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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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












1 Answer
1






active

oldest

votes


















1














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)





share|improve this answer
























  • Thank you for the response!

    – MhQ-6
    Nov 26 '18 at 15:12











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
});


}
});














draft saved

draft discarded


















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









1














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)





share|improve this answer
























  • Thank you for the response!

    – MhQ-6
    Nov 26 '18 at 15:12
















1














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)





share|improve this answer
























  • Thank you for the response!

    – MhQ-6
    Nov 26 '18 at 15:12














1












1








1







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)





share|improve this answer













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)






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 '18 at 7:57









CalimoCalimo

4,31422248




4,31422248













  • 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





Thank you for the response!

– MhQ-6
Nov 26 '18 at 15:12


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

To store a contact into the json file from server.js file using a class in NodeJS

Redirect URL with Chrome Remote Debugging Android Devices

Dieringhausen