<?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 logistic regression hyperparameter tuning in SAS Viya 3.5 in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/logistic-regression-hyperparameter-tuning-in-SAS-Viya-3-5/m-p/963648#M48339</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to tune the hyperparameters of a logistic regression model using a dataset that has a _partind_ column (train='1', validate='0', test='2') and using CAS capabilities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think PROC LOGSELECT is discarded since it has no AUTOTUNE statement such as PROC GRADBOOST even though it is CAS-enabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently trying the Autotune Action Set (as per the example in&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/casactml_autotune_examples66.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/casactml_autotune_examples66.htm&lt;/A&gt;). However, documentation is not quite clear to me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1:&lt;/P&gt;&lt;P&gt;Given the following code (which is in the link above)&lt;/P&gt;&lt;LI-CODE lang="sas"&gt; proc cas noqueue;
     autotune.tuneLogistic /
         trainOptions={
             table={name='GETSTARTED'},
             class={{vars={'C'}}},
             model={
                 depVars={{name='y'}},
                 effects={
                     {vars={'C', 'x1', 'x2', 'x3', 'x4', 'x5',
                          'x6', 'x7', 'x8', 'x9', 'x10'}}
                 }
             },
             savestate={name="logistic_getstarted_model"}
         }
         tunerOptions={seed=12345}

         /* Tuning Parameters

         You do not need to specify any tuning parameters for the default
         tuning process. If you want to make adjustments to the default
         tuning process, uncomment the following block of code and change
         any of the tuning parameters' attributes.

         tuningParameters={
            {name="method",
               valueList={"BACKWARD", "FORWARD", "LASSO", "NONE", "STEPWISE"},
                                         initValue="STEPWISE",   exclude=false},
           {name="slEntry",    lb=0.01, ub=0.99, initValue=0.05, exclude=false},
           {name="slStay",     lb=0.01, ub=0.99, initValue=0.05, exclude=false},
           {name="stopHorizon",lb=1,    ub=5,    initValue=3,    exclude=false},
           {name="lassoRho",   lb=0.1,  ub=0.9,  initValue=0.8,  exclude=false},
           {name="lassoSteps", lb=10,   ub=100,  initValue=20,   exclude=false}
         }

         */

     ;
     ods output TunerResults      = TuneResults(keep=MisclassErr);
     ods output EvaluationHistory = EvalHistory;
     ods output IterationHistory  = IterHistory;
     run;
  quit;&lt;/LI-CODE&gt;&lt;P&gt;and considering the tuningParameters={{autotuneTuningParmDefinition-1},...} section of the documentation (&lt;A href="https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/cas-autotune-tunelogistic.htm#SAS.cas-autotune-tunelogistic-tuningparameters-namepath" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/cas-autotune-tunelogistic.htm#SAS.cas-autotune-tunelogistic-tuningparameters-namepath&lt;/A&gt;), where it is stated that each autotuneTuningParmDefinition-n has a namePath="string" (alias name) such that &lt;EM&gt;"it&amp;nbsp;specifies the name path of a tuning parameter. For a nested action parameter, this parameter specifies a dot-separated path that includes all its parent parameter names. For a top-level action parameter, this parameter is simply the name of the parameter."&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the user supposed to fully specify the parameter that is being referenced from the logistic action ??? If so, how does SAS Viya know that &lt;EM&gt;{name="method",...} &lt;/EM&gt;in the example code above&amp;nbsp;refers to the parameter hierarchy &lt;EM&gt;regression.logistic / selection={method&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"BACKWARD" | "ELASTICNET" | "FORWARD" | "LASSO" | "NONE" | "STEPWISE"} &lt;/EM&gt;???&amp;nbsp;(I assume this is the hyperparameter that was referenced in the example code because of the similarity in options; see&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_061/casactstat/cas-regression-logistic.htm#SAS.cas-regression-logistic-selection" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/v_061/casactstat/cas-regression-logistic.htm#SAS.cas-regression-logistic-selection&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shouldn't &lt;EM&gt;{name="method",...}&lt;/EM&gt; be &lt;EM&gt;{name="selection.method"}&lt;/EM&gt; because there are multiple other "method" parameters such as&amp;nbsp;&lt;EM&gt;regression.logistic / polynomial={{standarize={&lt;SPAN class=""&gt;method&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"MOMENTS" | "MRANGE" | "WMOMENTS"&lt;/SPAN&gt;}, ...}, ...}&amp;nbsp;&lt;/EM&gt;???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 2:&lt;/P&gt;&lt;P&gt;As per the predefined&amp;nbsp; train-validate-test partition of my dataset, I think I should use&amp;nbsp;&lt;EM&gt;userDefinedPartition=TRUE|FALSE "&lt;SPAN&gt;when set to True, includes a user-defined partition for training and scoring."&lt;/SPAN&gt;&lt;/EM&gt;&amp;nbsp; (&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/cas-autotune-tunelogistic.htm#SAS.cas-autotune-tunelogistic-tuneroptions-userdefinedpartition" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/cas-autotune-tunelogistic.htm#SAS.cas-autotune-tunelogistic-tuneroptions-userdefinedpartition&lt;/A&gt;&amp;nbsp;). But how ??? There is no reference on how to tell SAS what my partition column and values are.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Apr 2025 01:47:24 GMT</pubDate>
    <dc:creator>WilliamMunoz</dc:creator>
    <dc:date>2025-04-08T01:47:24Z</dc:date>
    <item>
      <title>logistic regression hyperparameter tuning in SAS Viya 3.5</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/logistic-regression-hyperparameter-tuning-in-SAS-Viya-3-5/m-p/963648#M48339</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to tune the hyperparameters of a logistic regression model using a dataset that has a _partind_ column (train='1', validate='0', test='2') and using CAS capabilities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think PROC LOGSELECT is discarded since it has no AUTOTUNE statement such as PROC GRADBOOST even though it is CAS-enabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently trying the Autotune Action Set (as per the example in&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/casactml_autotune_examples66.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/casactml_autotune_examples66.htm&lt;/A&gt;). However, documentation is not quite clear to me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1:&lt;/P&gt;&lt;P&gt;Given the following code (which is in the link above)&lt;/P&gt;&lt;LI-CODE lang="sas"&gt; proc cas noqueue;
     autotune.tuneLogistic /
         trainOptions={
             table={name='GETSTARTED'},
             class={{vars={'C'}}},
             model={
                 depVars={{name='y'}},
                 effects={
                     {vars={'C', 'x1', 'x2', 'x3', 'x4', 'x5',
                          'x6', 'x7', 'x8', 'x9', 'x10'}}
                 }
             },
             savestate={name="logistic_getstarted_model"}
         }
         tunerOptions={seed=12345}

         /* Tuning Parameters

         You do not need to specify any tuning parameters for the default
         tuning process. If you want to make adjustments to the default
         tuning process, uncomment the following block of code and change
         any of the tuning parameters' attributes.

         tuningParameters={
            {name="method",
               valueList={"BACKWARD", "FORWARD", "LASSO", "NONE", "STEPWISE"},
                                         initValue="STEPWISE",   exclude=false},
           {name="slEntry",    lb=0.01, ub=0.99, initValue=0.05, exclude=false},
           {name="slStay",     lb=0.01, ub=0.99, initValue=0.05, exclude=false},
           {name="stopHorizon",lb=1,    ub=5,    initValue=3,    exclude=false},
           {name="lassoRho",   lb=0.1,  ub=0.9,  initValue=0.8,  exclude=false},
           {name="lassoSteps", lb=10,   ub=100,  initValue=20,   exclude=false}
         }

         */

     ;
     ods output TunerResults      = TuneResults(keep=MisclassErr);
     ods output EvaluationHistory = EvalHistory;
     ods output IterationHistory  = IterHistory;
     run;
  quit;&lt;/LI-CODE&gt;&lt;P&gt;and considering the tuningParameters={{autotuneTuningParmDefinition-1},...} section of the documentation (&lt;A href="https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/cas-autotune-tunelogistic.htm#SAS.cas-autotune-tunelogistic-tuningparameters-namepath" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/cas-autotune-tunelogistic.htm#SAS.cas-autotune-tunelogistic-tuningparameters-namepath&lt;/A&gt;), where it is stated that each autotuneTuningParmDefinition-n has a namePath="string" (alias name) such that &lt;EM&gt;"it&amp;nbsp;specifies the name path of a tuning parameter. For a nested action parameter, this parameter specifies a dot-separated path that includes all its parent parameter names. For a top-level action parameter, this parameter is simply the name of the parameter."&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the user supposed to fully specify the parameter that is being referenced from the logistic action ??? If so, how does SAS Viya know that &lt;EM&gt;{name="method",...} &lt;/EM&gt;in the example code above&amp;nbsp;refers to the parameter hierarchy &lt;EM&gt;regression.logistic / selection={method&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"BACKWARD" | "ELASTICNET" | "FORWARD" | "LASSO" | "NONE" | "STEPWISE"} &lt;/EM&gt;???&amp;nbsp;(I assume this is the hyperparameter that was referenced in the example code because of the similarity in options; see&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_061/casactstat/cas-regression-logistic.htm#SAS.cas-regression-logistic-selection" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/v_061/casactstat/cas-regression-logistic.htm#SAS.cas-regression-logistic-selection&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shouldn't &lt;EM&gt;{name="method",...}&lt;/EM&gt; be &lt;EM&gt;{name="selection.method"}&lt;/EM&gt; because there are multiple other "method" parameters such as&amp;nbsp;&lt;EM&gt;regression.logistic / polynomial={{standarize={&lt;SPAN class=""&gt;method&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"MOMENTS" | "MRANGE" | "WMOMENTS"&lt;/SPAN&gt;}, ...}, ...}&amp;nbsp;&lt;/EM&gt;???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 2:&lt;/P&gt;&lt;P&gt;As per the predefined&amp;nbsp; train-validate-test partition of my dataset, I think I should use&amp;nbsp;&lt;EM&gt;userDefinedPartition=TRUE|FALSE "&lt;SPAN&gt;when set to True, includes a user-defined partition for training and scoring."&lt;/SPAN&gt;&lt;/EM&gt;&amp;nbsp; (&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/cas-autotune-tunelogistic.htm#SAS.cas-autotune-tunelogistic-tuneroptions-userdefinedpartition" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/da/pgmsascdc/v_061/casactml/cas-autotune-tunelogistic.htm#SAS.cas-autotune-tunelogistic-tuneroptions-userdefinedpartition&lt;/A&gt;&amp;nbsp;). But how ??? There is no reference on how to tell SAS what my partition column and values are.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 01:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/logistic-regression-hyperparameter-tuning-in-SAS-Viya-3-5/m-p/963648#M48339</guid>
      <dc:creator>WilliamMunoz</dc:creator>
      <dc:date>2025-04-08T01:47:24Z</dc:date>
    </item>
  </channel>
</rss>

