<?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 PROC HPBNET: Compute Test Set Accuracy in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/PROC-HPBNET-Compute-Test-Set-Accuracy/m-p/965234#M11041</link>
    <description>&lt;P&gt;I am running&amp;nbsp;PROC HPBNET on regular SAS for Naive Bayes classification. Not Viya, not Enterprise Miner. If necessary, I can switch to Enterprise Miner, but I would strongly prefer not to. PROC HPBNET has run completely fine on regular SAS insofar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set split between train and test. According to documentation, "if you use a CODE statement, score code is generated and stored in a file that can be used for scoring purposes." I assume I can grab this CODE output and use it on my test data set. I can't seem to find an example thereof, but it is alluded to in Paper SAS474-2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I go about computing my test results?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Apr 2025 09:20:39 GMT</pubDate>
    <dc:creator>KeanuHua4</dc:creator>
    <dc:date>2025-04-28T09:20:39Z</dc:date>
    <item>
      <title>PROC HPBNET: Compute Test Set Accuracy</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/PROC-HPBNET-Compute-Test-Set-Accuracy/m-p/965234#M11041</link>
      <description>&lt;P&gt;I am running&amp;nbsp;PROC HPBNET on regular SAS for Naive Bayes classification. Not Viya, not Enterprise Miner. If necessary, I can switch to Enterprise Miner, but I would strongly prefer not to. PROC HPBNET has run completely fine on regular SAS insofar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set split between train and test. According to documentation, "if you use a CODE statement, score code is generated and stored in a file that can be used for scoring purposes." I assume I can grab this CODE output and use it on my test data set. I can't seem to find an example thereof, but it is alluded to in Paper SAS474-2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I go about computing my test results?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 09:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/PROC-HPBNET-Compute-Test-Set-Accuracy/m-p/965234#M11041</guid>
      <dc:creator>KeanuHua4</dc:creator>
      <dc:date>2025-04-28T09:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: PROC HPBNET: Compute Test Set Accuracy</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/PROC-HPBNET-Compute-Test-Set-Accuracy/m-p/965644#M11042</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The CODE statement converts the final BNET into SAS DATA step code that can be used for scoring. The code is written to the file that is specified by&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=" aa-argument"&gt;filename&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;It's the &lt;STRONG&gt;body of the data step&lt;/STRONG&gt; that is written to the file (no data statement, no set statement and no run statement).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename abc '/srv/nfs/kubedata/compute-landingzone/SBXKOK/files/hpbnet_my_scorecode.sas'; 

proc hpbnet data=sashelp.Iris numbin=3 structure=Naive maxparents=1
         prescreening=0 varselect=0;
     target Species;
     input PetalWidth PetalLength SepalLength SepalWidth/level=INT;
     output network=network;
     code file=abc;
 run;

data work.new_data_scored;
 set sashelp.iris;
 %INCLUDE abc / source2;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Ciao,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2025 08:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/PROC-HPBNET-Compute-Test-Set-Accuracy/m-p/965644#M11042</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2025-05-03T08:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROC HPBNET: Compute Test Set Accuracy</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/PROC-HPBNET-Compute-Test-Set-Accuracy/m-p/965674#M11043</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Forgot to say I had actually figured this a few days after posting when I realized the code file looks like, well, code. Unfortunately, it's not quite so clear if this is &lt;EM&gt;mathematically&lt;/EM&gt; the same naive Bayes algorithm as GaussianNB in Python (scikit-learn) or naiveBayes in R (e1071), which are what I'm using for class. Doesn't look like I'll be able to use this, but it was a good learning experience at least.&lt;/P&gt;</description>
      <pubDate>Sun, 04 May 2025 05:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/PROC-HPBNET-Compute-Test-Set-Accuracy/m-p/965674#M11043</guid>
      <dc:creator>KeanuHua4</dc:creator>
      <dc:date>2025-05-04T05:49:42Z</dc:date>
    </item>
  </channel>
</rss>

