<?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: How to copy the list of column contributions of a random forest using a script? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880794#M104456</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I use the Chinese version of JMP, but it is feasible to run this code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Diabetes.jmp" );
cNa=dt&amp;lt;&amp;lt;get column names;xF=As List(cNa[3::ncol(dt)]);
rpt = New Window("Bootstrap Forest of Y",
	Data Table("Diabetes") &amp;lt;&amp;lt; Bootstrap Forest(
		Y(1),
		X(Eval( xF )),
		Validation(:Validation),
		Method("Bootstrap Forest"),
		Column Contributions(1),
		Minimum Splits per Tree(5),
		Portion Bootstrap(1),
		Number Terms(3),
		Number Trees(25),
		Go
	)
);
Wait(0);
rpt["Bootstrap Forest for Y", "Column Contributions", Table Box(1)] &amp;lt;&amp;lt;Make Into Data Table;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 21 Jun 2025 08:29:41 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2025-06-21T08:29:41Z</dc:date>
    <item>
      <title>How to copy the list of column contributions of a random forest using a script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880691#M104439</link>
      <description>&lt;P&gt;Thanks Experts!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Diabetes.jmp" );
p= dt &amp;lt;&amp;lt; Bootstrap Forest(
	Y( :Y ),
	X(
		:Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH,
		:LTG, :Glucose
	),
	Validation( :Validation ),
	Minimum Splits Per Tree( 5 ),
	Portion Bootstrap( 1 ),
	Number Terms( 3 ),
	Number Trees( 25 ),
	Go
);
p_report = p &amp;lt;&amp;lt; Report;
tb = p_report &amp;lt;&amp;lt; XPath("//OutlineBox[text()='列贡献']//TableBox");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;no work&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-06-20_22-30-47.png" style="width: 971px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77115i206DE46CEE4A134C/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025-06-20_22-30-47.png" alt="2025-06-20_22-30-47.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2025 14:35:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880691#M104439</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2025-06-20T14:35:38Z</dc:date>
    </item>
    <item>
      <title>回复： How to copy the list of column contributions of a random forest using a script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880702#M104440</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-06-20_22-36-37.png" style="width: 347px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77116i762A341806A47030/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025-06-20_22-36-37.png" alt="2025-06-20_22-36-37.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2025 14:37:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880702#M104440</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2025-06-20T14:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the list of column contributions of a random forest using a script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880705#M104441</link>
      <description>&lt;P&gt;Use Make Into Data table, take the source script from that and modify as needed&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
rpt = New Window("Diabetes - Bootstrap Forest of Y",
	Data Table("Diabetes") &amp;lt;&amp;lt; Bootstrap Forest(
		Y(:Y),
		X(
			:Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG,
			:Glucose
		),
		Validation(:Validation),
		Method("Bootstrap Forest"),
		Column Contributions(1),
		Minimum Splits per Tree(5),
		Portion Bootstrap(1),
		Number Terms(3),
		Number Trees(25),
		Go
	)
);
Wait(0);
rpt["Bootstrap Forest for Y", "Column Contributions", Table Box(1)] &amp;lt;&amp;lt;
Make Into Data Table;
rpt &amp;lt;&amp;lt; Close Window;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Diabetes.jmp");
bsf = dt &amp;lt;&amp;lt; Bootstrap Forest(
	Y(:Y),
	X(:Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose),
	Validation(:Validation),
	Minimum Splits Per Tree(5),
	Portion Bootstrap(1),
	Number Terms(3),
	Number Trees(25),
	Column Contributions(1),
	Go
);
Wait(0);


dt_res = Report(bsf)[Outline Box("Bootstrap Forest for ?"), Outline Box("Column Contributions"), Table Box(1)] &amp;lt;&amp;lt; Make Into Data Table(Invisible);
m = dt_res[0, 0];
Close(dt_res, no save);

// could also 
m = Report(bsf)[Outline Box("Bootstrap Forest for ?"), Outline Box("Column Contributions"), Table Box(1)] &amp;lt;&amp;lt; get;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;If you just want the columns, you can build it from the resulting list or&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;m = Report(bsf)[Outline Box("Bootstrap Forest for ?"), Outline Box("Column Contributions"), Table Box(1), StringColBox("Term")] &amp;lt;&amp;lt; Copy Column;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Jun 2025 15:26:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880705#M104441</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-20T15:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the list of column contributions of a random forest using a script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880793#M104455</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I still didn't succeed with my own actual data.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=Current Data Table();for(i=5,i&amp;lt;=ncol(dt),i++,if(Column(i)&amp;lt;&amp;lt;Get Name=="xx",Break()));ss=i+1;cNa=dt&amp;lt;&amp;lt;get column names;cNa=dt&amp;lt;&amp;lt;get column names;xF=As List(cNa[ss::ncol(dt)]);
rpt = New Window("Bootstrap Forest of Y",
dt &amp;lt;&amp;lt; Bootstrap Forest(
	Y( Column( 3 ) ),
	X( Eval( xF ) ),
	Validation( :Validation ),
	Method( "Bootstrap Forest" ),
	Portion Bootstrap( 1 ),
	Number Terms( 46 ),
	Number Trees( 100 ),
	Go
));
Wait(0);rpt["Bootstrap Forest for Y", "Column Contributions", Table Box(1)] &amp;lt;&amp;lt;Make Into Data Table;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-06-21_16-23-00.png" style="width: 946px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77144i26A8E679104F5A8A/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025-06-21_16-23-00.png" alt="2025-06-21_16-23-00.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jun 2025 08:26:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880793#M104455</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2025-06-21T08:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the list of column contributions of a random forest using a script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880794#M104456</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I use the Chinese version of JMP, but it is feasible to run this code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Diabetes.jmp" );
cNa=dt&amp;lt;&amp;lt;get column names;xF=As List(cNa[3::ncol(dt)]);
rpt = New Window("Bootstrap Forest of Y",
	Data Table("Diabetes") &amp;lt;&amp;lt; Bootstrap Forest(
		Y(1),
		X(Eval( xF )),
		Validation(:Validation),
		Method("Bootstrap Forest"),
		Column Contributions(1),
		Minimum Splits per Tree(5),
		Portion Bootstrap(1),
		Number Terms(3),
		Number Trees(25),
		Go
	)
);
Wait(0);
rpt["Bootstrap Forest for Y", "Column Contributions", Table Box(1)] &amp;lt;&amp;lt;Make Into Data Table;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 21 Jun 2025 08:29:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880794#M104456</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2025-06-21T08:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy the list of column contributions of a random forest using a script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880800#M104457</link>
      <description>&lt;P&gt;Notice a difference between our scripts?&lt;/P&gt;
&lt;LI-SPOILER&gt;I'm using different outline box name than you are as I'm using wild card ? on purpose to replace the column name&lt;/LI-SPOILER&gt;
&lt;P&gt;You could possibly skip the first outline box reference and it should still work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jun 2025 11:31:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-copy-the-list-of-column-contributions-of-a-random-forest/m-p/880800#M104457</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-21T11:31:02Z</dc:date>
    </item>
  </channel>
</rss>

