<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Urgent,how to adjust probabilities after oversampling? Please Help, Thank you in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170814#M1943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Hi Kanyange,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;You can use this equation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;P_i** = ( P_i*&amp;nbsp; x&amp;nbsp; &lt;EM style="font-weight: inherit; font-family: inherit;"&gt;R_0 &lt;/EM&gt;x&amp;nbsp; &lt;EM style="font-weight: inherit; font-family: inherit;"&gt;P_1) / &lt;/EM&gt;( (1-P_i*) (&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;R_1)(P_0)&amp;nbsp; +&amp;nbsp; &lt;/EM&gt;(P_i*)(&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;R_0)(P_1) )&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;where:&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;P_i* is the unadjusted probability you get from your model&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;R_0 &lt;/EM&gt;and R&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;_1 &lt;/EM&gt;are the sample proportions of 1 and 0 respectively&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;P_0 &lt;/EM&gt;and P&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;_1 &lt;/EM&gt;are the original event and non_event rates (population rates)&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;P_i** is the true probability&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/232372/edit" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Oct 2014 12:51:22 GMT</pubDate>
    <dc:creator>JakesVenter</dc:creator>
    <dc:date>2014-10-10T12:51:22Z</dc:date>
    <item>
      <title>Urgent,how to adjust probabilities after oversampling? Please Help, Thank you</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170809#M1938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;I have oversampled my data to build a logistic regression model (50/50). The original response rate was for example 0.6%. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Is there any formula that will help me to adjust my scores? I have found this below online (attached PDF), but I am struggling to understand how it works...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Your help would be much appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;A href="http://www.dnbtechnology.com/pdf/DandB-Correcting%20Sample%20Bias%20in%20Oversampled%20Logistic%20Modeling%20Building%20Stable%20Models%20from%20Data%20with%20Very%20Low%20Event%20Count.pdf"&gt;http://www.dnbtechnology.com/pdf/DandB-Correcting%20Sample%20Bias%20in%20Oversampled%20Logistic%20Modeling%20Building%20Stable%20Models%20from%20Data%20with%20Very%20Low%20Event%20Count.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Many Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 08:43:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170809#M1938</guid>
      <dc:creator>Kanyange</dc:creator>
      <dc:date>2014-10-03T08:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent,how to adjust probabilities after oversampling? Please Help, Thank you</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170810#M1939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use priorevent=0.6 in score statement of proc logistic to get adjusted scores.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 14:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170810#M1939</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-10-03T14:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent,how to adjust probabilities after oversampling? Please Help, Thank you</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170811#M1940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kanyange,&lt;/P&gt;&lt;P&gt;The way I do it in Enterprise Miner is I add a Decisions node after my 50/50 sample.&lt;/P&gt;&lt;P&gt;Click the Decisions ellipsis, then go to the Decisions tab, and Specify "Do you want to use decisions" as Yes.&lt;/P&gt;&lt;P&gt;Go to the Decision Weights and fill the matrix according to each level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember that you are using the inverse of the prior probabilities. For your example, if the event A happens 0.6% or 0.006, then the inverse prior probability is 1/0.006=166.66. This means that event B has a prior probability of 0.994 and an inverse prior probability of 1.006&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then your table would look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="74" style="border: 1px solid rgb(0, 0, 0); width: 560px; height: 46px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Level&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Decision1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Decision2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;166.66&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1.006&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The decision node will take care of adjusting the weights of your model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your flow can look like: Data-&amp;gt;Sample-&amp;gt;Decisions-&amp;gt;Partition-&amp;gt;Regression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the answer you were looking for?&lt;/P&gt;&lt;P&gt;I generally don't use logistic regression for rare events, does logistic work well with your data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2014 15:21:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170811#M1940</guid>
      <dc:creator>M_Maldonado</dc:creator>
      <dc:date>2014-10-03T15:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent,how to adjust probabilities after oversampling? Please Help, Thank you</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170812#M1941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response....&lt;/P&gt;&lt;P&gt;I have used Enterpise Miner to build the model. I would like to adjust the formula , outsise Enterprise Miner,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found this formula in this forum, I think it's what I need : 1/(1+(1/population proportion)/(1/sample proportion-1)*(1/score-1));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 10:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170812#M1941</guid>
      <dc:creator>Kanyange</dc:creator>
      <dc:date>2014-10-06T10:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent,how to adjust probabilities after oversampling? Please Help, Thank you</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170813#M1942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This link might be useful:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/22/601.html" title="http://support.sas.com/kb/22/601.html"&gt;22601 - How do I adjust for oversampling the event level in a binary logistic model?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 12:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170813#M1942</guid>
      <dc:creator>yeliu</dc:creator>
      <dc:date>2014-10-09T12:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent,how to adjust probabilities after oversampling? Please Help, Thank you</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170814#M1943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Hi Kanyange,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;You can use this equation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;P_i** = ( P_i*&amp;nbsp; x&amp;nbsp; &lt;EM style="font-weight: inherit; font-family: inherit;"&gt;R_0 &lt;/EM&gt;x&amp;nbsp; &lt;EM style="font-weight: inherit; font-family: inherit;"&gt;P_1) / &lt;/EM&gt;( (1-P_i*) (&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;R_1)(P_0)&amp;nbsp; +&amp;nbsp; &lt;/EM&gt;(P_i*)(&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;R_0)(P_1) )&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;where:&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;P_i* is the unadjusted probability you get from your model&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;R_0 &lt;/EM&gt;and R&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;_1 &lt;/EM&gt;are the sample proportions of 1 and 0 respectively&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;P_0 &lt;/EM&gt;and P&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;_1 &lt;/EM&gt;are the original event and non_event rates (population rates)&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;P_i** is the true probability&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/232372/edit" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 12:51:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170814#M1943</guid>
      <dc:creator>JakesVenter</dc:creator>
      <dc:date>2014-10-10T12:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent,how to adjust probabilities after oversampling? Please Help, Thank you</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170815#M1944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand how to use Decisions node for adjusting probabilities. I have 0.7% response rate with 6,000 responses. I used Sample node and created a sample with 50/50 response rate. When I run the sample with Neural Network and Random Forest, I see the results with ROC but my score data was not adjusted to 0.7%. Then I redid everhthing with Decision node; Data--&amp;gt;Sample--&amp;gt;Decisions--&amp;gt;Data Portition (as described above with Decision Weights. In Prior Probabilities, Prior is not 50% it is already 0.7% . I still changed the adjusted prior to 0.7%. Count is 6000/6000). Now, all my results changed. All I see is the baseline with all the models overlapped in my ROC (Zero True Positive and Zero False Positive). I have the score data with adjusted probabilities but I am not sure if I am doing the right thing. I just don't understant how EM is using this process with the sample data. I appreciate any of your comments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 23:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/170815#M1944</guid>
      <dc:creator>aysin</dc:creator>
      <dc:date>2015-08-27T23:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent,how to adjust probabilities after oversampling? Please Help, Thank you</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/319585#M4801</link>
      <description>&lt;P&gt;Hi Aysin, you problem is similar to mine, did you get any soulution?As I understand you used two sample nodes to get the prior adjusted. Can I used two decision nodes to make it done? Looks like a solution to me. The advange with the decision node is that EM do all the adjustment by itself.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 16:26:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Urgent-how-to-adjust-probabilities-after-oversampling-Please/m-p/319585#M4801</guid>
      <dc:creator>MagicalEmerald</dc:creator>
      <dc:date>2016-12-16T16:26:58Z</dc:date>
    </item>
  </channel>
</rss>

