<?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 How to get non-duplicate column names from the &amp;quot;leaf label formula&amp;quot; of decision tree model? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-non-duplicate-column-names-from-the-quot-leaf-label/m-p/684690#M87060</link>
    <description>&lt;P&gt;For example, use the following JSL to get the Leaf Label Formula.Extract the column names from the formula in the first 10 rows.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d0 = Open( "$SAMPLE_DATA/Equity.jmp" );
p=Partition(
	Y( :BAD ),
	X(
		:LOAN, :MORTDUE, :VALUE, :REASON, :JOB, :YOJ, :DEROG, :DELINQ, :CLAGE, :NINQ,
		:CLNO, :DEBTINC
	),
	Validation Portion( 0.3 )
);
p&amp;lt;&amp;lt;go;Wait(2);
p &amp;lt;&amp;lt; save leaf label formula;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 07 Oct 2023 05:56:54 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2023-10-07T05:56:54Z</dc:date>
    <item>
      <title>How to get non-duplicate column names from the "leaf label formula" of decision tree model?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-duplicate-column-names-from-the-quot-leaf-label/m-p/684690#M87060</link>
      <description>&lt;P&gt;For example, use the following JSL to get the Leaf Label Formula.Extract the column names from the formula in the first 10 rows.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d0 = Open( "$SAMPLE_DATA/Equity.jmp" );
p=Partition(
	Y( :BAD ),
	X(
		:LOAN, :MORTDUE, :VALUE, :REASON, :JOB, :YOJ, :DEROG, :DELINQ, :CLAGE, :NINQ,
		:CLNO, :DEBTINC
	),
	Validation Portion( 0.3 )
);
p&amp;lt;&amp;lt;go;Wait(2);
p &amp;lt;&amp;lt; save leaf label formula;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Oct 2023 05:56:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-duplicate-column-names-from-the-quot-leaf-label/m-p/684690#M87060</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-10-07T05:56:54Z</dc:date>
    </item>
    <item>
      <title>回复： How can duplicate column names not be extracted from the "Leaf Label Formula" of the decision tree model?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-duplicate-column-names-from-the-quot-leaf-label/m-p/684696#M87061</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-10-07_11-56-51.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57266i2C911C634E05A02A/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-10-07_11-56-51.png" alt="2023-10-07_11-56-51.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2023 05:27:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-duplicate-column-names-from-the-quot-leaf-label/m-p/684696#M87061</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-10-07T05:27:26Z</dc:date>
    </item>
    <item>
      <title>回复： How can duplicate column names not be extracted from the "Leaf Label Formula" of the decision tree model?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-duplicate-column-names-from-the-quot-leaf-label/m-p/684711#M87062</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Current Data Table( d0 );
txt = "";
For( i = 1, i &amp;lt;= 10, i++,
	If( i == 1,
		a = "",
		a = "aaa"
	);
	nn = d0[i, "Leaf Label Formula"];
	txt = txt || a || nn;
);
tx = "ccc\!n" || Substitute( txt, "&amp;amp;", "\!n", "aaa", "\!n", " or Missing", "", " not Missing", "", " Is Missing", "" );
tx = Substitute( tx, "&amp;gt;", "\!t&amp;gt;", "&amp;lt;", "\!t&amp;lt;", "(", "\!t(" );
d1 = Open( Char To Blob( tx ), "text" );
d2 = d1 &amp;lt;&amp;lt; Summary( Group( ccc ), Freq( 0 ), Weight( 0 ), Link to original data table( 0 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Oct 2023 11:22:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-duplicate-column-names-from-the-quot-leaf-label/m-p/684711#M87062</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-10-07T11:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get non-duplicate column names from the "leaf label formula" of decision tree model?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-non-duplicate-column-names-from-the-quot-leaf-label/m-p/684720#M87063</link>
      <description>&lt;P&gt;You could loop over all the possible column names and if match is found, add it to associative array (and remove from the column listing if you want to)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

input_cols = {"LOAN", "MORTDUE", "VALUE", "REASON", "JOB", "YOJ", "DEROG", "DELINQ", "CLAGE", "NINQ", "CLNO", "DEBTINC"};

dt = Open("$SAMPLE_DATA/Equity.jmp");
part = dt &amp;lt;&amp;lt; Partition(
	Y(:BAD),
	X(Eval(input_cols)),
	Validation Portion(0.3)
);
part &amp;lt;&amp;lt; go;
part &amp;lt;&amp;lt; save leaf label formula;
part &amp;lt;&amp;lt; close window;

aa_cols = Associative Array();

For Each({row_val}, dt[1::10, "Leaf Label Formula"],
	input_cols_temp = input_cols;
	For Each({input_col, idx}, input_cols,
		If(Contains(row_val, input_col),
			aa_cols[input_col] = 1;
			Remove From(input_cols_temp, idx);
		);
	);
	input_cols = input_cols_temp;
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2023 15:02:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-non-duplicate-column-names-from-the-quot-leaf-label/m-p/684720#M87063</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-07T15:02:02Z</dc:date>
    </item>
  </channel>
</rss>

