<?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: Logistic Regression - Training and validation score exactly the same. in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-Training-and-validation-score-exactly-the/m-p/604732#M29383</link>
    <description>&lt;P&gt;Clearly, you have created TRAIN and VALID incorrectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first debugging tool for you to try is to actually look at, with your own eyes, the two different data sets named TRAIN and VALID and see if they actually are different. We can't do that for you, because we don't have those data sets.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Also, you need to examine how these data sets were created to make sure you haven't somehow done something that would cause this result.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2019 22:03:35 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-11-16T22:03:35Z</dc:date>
    <item>
      <title>Logistic Regression - Training and validation score exactly the same.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-Training-and-validation-score-exactly-the/m-p/600075#M29187</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use the all subset selection (assess &amp;amp; fitandscore )from the&amp;nbsp;Predictive Modeling Using Logistic Regression course notes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But for some reason, my training and validation scores are basically the same (Graph below) and the profit plot is an horizontal line, any advice on why is this happening?&amp;nbsp; I double check the codes and the training/validation dataset and I don't see any issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only possible source of concern is that all my input variables are either binary or categorical variables(converted to dummy variables with reference level), would that be a concern?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro assess(data=,inputcount=,inputsinmodel=,index=);&lt;/P&gt;&lt;P&gt;proc sort data=scored&amp;amp;data;&lt;BR /&gt;by descending p_1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data assess;&lt;BR /&gt;attrib DATAROLE length=$5;&lt;BR /&gt;retain sse 0 csum 0 DATAROLE "&amp;amp;data";&lt;BR /&gt;array n[0:1,0:1] _temporary_ (0 0 0 0);&lt;BR /&gt;array w[0:1] _temporary_&lt;BR /&gt;(%sysevalf(&amp;amp;pi0/&amp;amp;rho0) %sysevalf(&amp;amp;pi1/&amp;amp;rho1));&lt;BR /&gt;keep DATAROLE INPUT_COUNT INDEX&lt;BR /&gt;TOTAL_PROFIT OVERALL_AVG_PROFIT ASE C;&lt;/P&gt;&lt;P&gt;set scored&amp;amp;data end=last;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;d1=&amp;amp;PF11*p_1+&amp;amp;PF01*p_0;&lt;BR /&gt;d0=&amp;amp;PF10*p_1+&amp;amp;PF00*p_0;&lt;/P&gt;&lt;P&gt;t=(strip(ischurn)="1");&lt;BR /&gt;d=(d1&amp;gt;d0);&lt;/P&gt;&lt;P&gt;n[t,d] + w[t];&lt;BR /&gt;sse + (ischurn-p_1)**2;&lt;BR /&gt;csum + ((n[1,1]+n[1,0])*(1-t)*w[0]);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if last then do;&lt;BR /&gt;INPUT_COUNT=&amp;amp;inputcount;&lt;BR /&gt;TOTAL_PROFIT =&lt;BR /&gt;sum(&amp;amp;PF11*n[1,1],&amp;amp;PF10*n[1,0],&amp;amp;PF01*n[0,1],&amp;amp;PF00*n[0,0]);&lt;BR /&gt;OVERALL_AVG_PROFIT =&lt;BR /&gt;TOTAL_PROFIT/sum(n[0,0],n[1,0],n[0,1],n[1,1]);&lt;BR /&gt;ASE = sse/sum(n[0,0],n[1,0],n[0,1],n[1,1]);&lt;BR /&gt;C = csum/(sum(n[0,0],n[0,1])*sum(n[1,0],n[1,1]));&lt;BR /&gt;index=&amp;amp;index;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc append base=results data=assess force;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend assess;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro fitandscore();&lt;BR /&gt;proc datasets&lt;BR /&gt;library=work&lt;BR /&gt;nodetails&lt;BR /&gt;nolist;&lt;BR /&gt;delete results;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%do model_indx=1 %to &amp;amp;lastindx;&lt;BR /&gt;%let im=&amp;amp;&amp;amp;inputs&amp;amp;model_indx;&lt;BR /&gt;%let ic=&amp;amp;&amp;amp;ic&amp;amp;model_indx;&lt;/P&gt;&lt;P&gt;proc logistic data=churnmod.imputed2 des NAMELEN=50;&lt;BR /&gt;model ischurn=&amp;amp;im;&lt;BR /&gt;score data=churnmod.imputed2&lt;BR /&gt;out=scoredtrain(keep=ischurn p_1 p_0)&lt;BR /&gt;priorevent=&amp;amp;pi1;&lt;BR /&gt;score data=churnmod.valid2&lt;BR /&gt;out=scoredvalid(keep=ischurn p_1 p_0)&lt;BR /&gt;priorevent=&amp;amp;pi1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%assess(data=train,&lt;BR /&gt;inputcount=&amp;amp;ic,&lt;BR /&gt;inputsinmodel=&amp;amp;im,&lt;BR /&gt;index=&amp;amp;model_indx);&lt;BR /&gt;%assess(data=VALID,&lt;BR /&gt;inputcount=&amp;amp;ic,&lt;BR /&gt;inputsinmodel=&amp;amp;im,&lt;BR /&gt;index=&amp;amp;model_indx);&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;%mend fitandscore;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33461iFC0037E0B5BCB812/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS.PNG" alt="SAS.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas2.PNG" style="width: 534px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33462i3364BF85EBE3F4E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas2.PNG" alt="sas2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 14:20:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-Training-and-validation-score-exactly-the/m-p/600075#M29187</guid>
      <dc:creator>Fae</dc:creator>
      <dc:date>2019-10-29T14:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic Regression - Training and validation score exactly the same.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-Training-and-validation-score-exactly-the/m-p/604730#M29382</link>
      <description>&lt;P&gt;To help us better assist, please provide sample data that would yield these results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;-unison&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 18:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-Training-and-validation-score-exactly-the/m-p/604730#M29382</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2019-11-16T18:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic Regression - Training and validation score exactly the same.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-Training-and-validation-score-exactly-the/m-p/604732#M29383</link>
      <description>&lt;P&gt;Clearly, you have created TRAIN and VALID incorrectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first debugging tool for you to try is to actually look at, with your own eyes, the two different data sets named TRAIN and VALID and see if they actually are different. We can't do that for you, because we don't have those data sets.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Also, you need to examine how these data sets were created to make sure you haven't somehow done something that would cause this result.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 22:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-Regression-Training-and-validation-score-exactly-the/m-p/604732#M29383</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-16T22:03:35Z</dc:date>
    </item>
  </channel>
</rss>

