<?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 can I set random seed into Random Index function? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-I-set-random-seed-into-Random-Index-function/m-p/215803#M43102</link>
    <description>&lt;P&gt;I use Random Index to generate a marix of random numbers. However, I would like to have same set of random numbers everytime I run the script. Can I set random seed for Random Index function?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2019 08:41:03 GMT</pubDate>
    <dc:creator>Shunee</dc:creator>
    <dc:date>2019-07-02T08:41:03Z</dc:date>
    <item>
      <title>How can I set random seed into Random Index function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-set-random-seed-into-Random-Index-function/m-p/215803#M43102</link>
      <description>&lt;P&gt;I use Random Index to generate a marix of random numbers. However, I would like to have same set of random numbers everytime I run the script. Can I set random seed for Random Index function?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 08:41:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-set-random-seed-into-Random-Index-function/m-p/215803#M43102</guid>
      <dc:creator>Shunee</dc:creator>
      <dc:date>2019-07-02T08:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set random seed into Random Index function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-set-random-seed-into-Random-Index-function/m-p/215810#M43105</link>
      <description>&lt;P&gt;Found an addin:&amp;nbsp; &lt;A href="https://community.jmp.com/t5/JMP-Add-Ins/Random-Seed-Reset/ta-p/21973" target="_blank"&gt;https://community.jmp.com/t5/JMP-Add-Ins/Random-Seed-Reset/ta-p/21973&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For simple values:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Random Reset( 1 );
Random Normal();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For an object:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj &amp;lt;&amp;lt; Set Seed( 1111 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For a platform:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Boston Housing.jmp" );
obj = Partition(
	Y( :chas ),
	X( :crim, :zn, :indus, :mvalue, :nox, :rooms, :age, :distance, :radial ),
	Method( "Bootstrap Forest" ),
	Set Random Seed( 1234 ),
	Go
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try Random Seed in the scritping index for further info:&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 09:24:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-set-random-seed-into-Random-Index-function/m-p/215810#M43105</guid>
      <dc:creator>Mauro_Gerber</dc:creator>
      <dc:date>2019-07-02T09:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set random seed into Random Index function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-set-random-seed-into-Random-Index-function/m-p/215812#M43107</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;I do not believe that you can set the seed for Random Index.&amp;nbsp; However, you can do a one time generation of the matrix you need and then save it to a text file.&amp;nbsp; You can then read in the matrix from the text file at the beginning of your script, and set the matrix that way.&amp;nbsp; Here is a simple illustration of creating a matrix, saving it to a text file, and then how to retrieve it.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;STRIKE&gt;&lt;CODE class=" language-jsl"&gt;x=random index(100, 10);
show(x);
save text file("$TEMP/random.txt", char(x));
x=[];
show(x);
x=parse(load text file("$TEMP/random.txt"));
show(x);
&lt;/CODE&gt;&lt;/STRIKE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRIKE&gt;You could also create a data table with the matrix values in a column, save the data table.&amp;nbsp; Then as needed open the saved table and read the values from the column into a matrix.&lt;/STRIKE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 10:40:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-set-random-seed-into-Random-Index-function/m-p/215812#M43107</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-07-04T10:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set random seed into Random Index function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-set-random-seed-into-Random-Index-function/m-p/216230#M43198</link>
      <description>&lt;P&gt;I was incorrect when I stated that there isn't a way to set the seed for a Random Index();&amp;nbsp; The Random Reset() function will do the job&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

Random Reset( 1 );
x=random index(100, 10);
show(x);
Random Reset( 1 );
x=random index(100, 10);
show(x);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jul 2019 10:39:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-set-random-seed-into-Random-Index-function/m-p/216230#M43198</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-07-04T10:39:09Z</dc:date>
    </item>
  </channel>
</rss>

