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)










0















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?










share|improve this question
























  • 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















0















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?










share|improve this question
























  • 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













0












0








0








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?










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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, 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

















  • 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
















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












1 Answer
1






active

oldest

votes


















0














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)


A ROC curve with the AUC displayed in grey






share|improve this answer
























    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%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









    0














    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)


    A ROC curve with the AUC displayed in grey






    share|improve this answer





























      0














      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)


      A ROC curve with the AUC displayed in grey






      share|improve this answer



























        0












        0








        0







        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)


        A ROC curve with the AUC displayed in grey






        share|improve this answer















        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)


        A ROC curve with the AUC displayed in grey







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 2 days ago

























        answered 2 days ago









        CalimoCalimo

        4,42422348




        4,42422348





























            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%2f55028009%2fr-auc-from-proc-package%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

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme