<?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 Unexpected Results from PROC HPSPLIT ... when run on a small sample in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/921569#M45803</link>
    <description>&lt;P&gt;&lt;FONT size="2"&gt;I’m running SAS on Demand for Academics and I am trying to learn the features of HPSPLIT. So, I ran a very small sample.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;The report “2-Fold Cross Validation Assessment of Pruning Parameter” shows the “&lt;STRONG&gt;Selected pruning parameter”&lt;/STRONG&gt; to occur at Leaves=1 with Avg Misclassification Rate of 0.5227.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;But the smallest Avg Misclassification Rate occurs at Leaves=4 (0.2864).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;See the attached PDF which contains the Reports.&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="2"&gt;Am I misreading the table and graphic? … The code to create these reports is given below.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; small;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;input x y $;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;datalines;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;4 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;4 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;4 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;4 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;ods graphics on;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;hpsplit&lt;/STRONG&gt; data = small seed=&lt;STRONG&gt;5&lt;/STRONG&gt; CVCC PLOTS=CVCC&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;cvmethod=random(&lt;STRONG&gt;2&lt;/STRONG&gt;) CVMODELFIT NODES=DETAIL;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;class y;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;model y = x;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;GROW entropy; &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;PRUNE costcomplexity;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2024 22:11:04 GMT</pubDate>
    <dc:creator>blund</dc:creator>
    <dc:date>2024-03-22T22:11:04Z</dc:date>
    <item>
      <title>Unexpected Results from PROC HPSPLIT ... when run on a small sample</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/921569#M45803</link>
      <description>&lt;P&gt;&lt;FONT size="2"&gt;I’m running SAS on Demand for Academics and I am trying to learn the features of HPSPLIT. So, I ran a very small sample.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;The report “2-Fold Cross Validation Assessment of Pruning Parameter” shows the “&lt;STRONG&gt;Selected pruning parameter”&lt;/STRONG&gt; to occur at Leaves=1 with Avg Misclassification Rate of 0.5227.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;But the smallest Avg Misclassification Rate occurs at Leaves=4 (0.2864).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;See the attached PDF which contains the Reports.&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="2"&gt;Am I misreading the table and graphic? … The code to create these reports is given below.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; small;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;input x y $;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;datalines;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;4 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;4 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;4 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;4 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;ods graphics on;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;hpsplit&lt;/STRONG&gt; data = small seed=&lt;STRONG&gt;5&lt;/STRONG&gt; CVCC PLOTS=CVCC&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;cvmethod=random(&lt;STRONG&gt;2&lt;/STRONG&gt;) CVMODELFIT NODES=DETAIL;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;class y;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;model y = x;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;GROW entropy; &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;PRUNE costcomplexity;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 22:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/921569#M45803</guid>
      <dc:creator>blund</dc:creator>
      <dc:date>2024-03-22T22:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected Results from PROC HPSPLIT ... when run on a small sample</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/921817#M45813</link>
      <description>&lt;P&gt;Can you post the log for this program? I'm not reproducing this behavior, but I'm not using SAS on Demand for Academics.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 16:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/921817#M45813</guid>
      <dc:creator>Mike_N</dc:creator>
      <dc:date>2024-03-26T16:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected Results from PROC HPSPLIT ... when run on a small sample</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/921843#M45814</link>
      <description>&lt;P&gt;Here is the Log file and Report file (I reran the SAS code today ... same Report)&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 18:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/921843#M45814</guid>
      <dc:creator>blund</dc:creator>
      <dc:date>2024-03-26T18:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected Results from PROC HPSPLIT ... when run on a small sample</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/921844#M45815</link>
      <description>&lt;P&gt;Here is the "About SAS Studio" drop down. Also the SAS code (again)&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 18:23:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/921844#M45815</guid>
      <dc:creator>blund</dc:creator>
      <dc:date>2024-03-26T18:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected Results from PROC HPSPLIT ... when run on a small sample</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/922171#M45826</link>
      <description>&lt;P&gt;Thank you for posting the log. I'm now able to reproduce your results. My machine defaults to using 4 threads for the computation, but I needed to use 2 threads to match your output. Note that you do so using the performance statement as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc hpsplit data=small seed=5 CVCC PLOTS=CVCC cvmethod=random(2) CVMODELFIT NODES=DETAIL;
	class y;
	model y = x;
	GROW entropy;  
	PRUNE costcomplexity;
	performance nthreads = 2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I suggest that you raise this issue with SAS technical support (make sure they also use nthreads = 2). I think what is happening is the selected tuning parameter is the one with the smallest average squared error based on cross validation. In the documentation for the '&lt;SPAN&gt;CVMETHOD= random' statement, it says "The average ASE across the&amp;nbsp;&lt;SPAN class=" aa-argument"&gt;k&lt;/SPAN&gt;&amp;nbsp;trees is the cross validation error for that set of trees .... the parameter that has the minimum cross validated error is used as the best parameter value." &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, to your point, you are fitting a classification tree, and the error metric for a classification tree is commonly the misclassification rate.&amp;nbsp; In fact, the documentation for prune statement, says "The error metric is misclassification rate for classification trees". I think it is worth confirming with technical support "that PROC HPSPLIT is working as intended.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 19:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Results-from-PROC-HPSPLIT-when-run-on-a-small-sample/m-p/922171#M45826</guid>
      <dc:creator>Mike_N</dc:creator>
      <dc:date>2024-03-28T19:11:03Z</dc:date>
    </item>
  </channel>
</rss>

