Comments (14)
yup, this was done just to get reproducible results over multiple runs with same
parameters.
I guess i will set a parameter in the next version to allow setting for a
random seed.
Thanks.
Original comment by abhirana
on 10 Jan 2010 at 11:28
from randomforest-matlab.
Has a random number seed been added? Is there any way of getting around this?
I need to run multiple times, and I keep getting the same output...
Thanks!
Michael
Original comment by [email protected]
on 19 Feb 2011 at 10:58
from randomforest-matlab.
hi Michael
i havent added that yet in. though the code just needs a line
like the first poster suggested add a line srand(time(NULL)); before this line
(CLASSIFICATION CODE)
http://code.google.com/p/randomforest-matlab/source/browse/trunk/RF_Class_C/src/
classRF.cpp#210
file is RF_Class_C/src/classRF.cpp
(REGRESSION CODE)
http://code.google.com/p/randomforest-matlab/source/browse/trunk/RF_Reg_C/src/re
g_RF.cpp#291
file is RF_Reg_C/src/reg_RF.cpp
and make sure that time.h is one of the include file at the top.
Then you just need to recompile, those compile_* scripts.
Original comment by abhirana
on 19 Feb 2011 at 11:04
from randomforest-matlab.
Thanks so much, I appreciate the quick response. Unfortunately I don't know
C++, or have a C compiler. I'll see what I can do, though. If I can download
a free compiler, I should be able to fight my way through it.
Thanks again. It's a great package, and has really helped a lot.
Michael
Original comment by [email protected]
on 19 Feb 2011 at 11:45
from randomforest-matlab.
Hi Michael
if you installed matlab, then it should have a compiler in. if not i can always
send you the compiled files
I guess you are using one of the precompiled package for windows.
are you using windows 32-bit or 64-bit? i can send you the compiled files at ur
gmail address, if thats fine.
Original comment by abhirana
on 19 Feb 2011 at 11:53
from randomforest-matlab.
Yeah, I'm using the precompiled package right now. If it's not too much of a
hassle for you, I would definitely appreciate if you would generate the
compiled files for me. It would be a WHOLE lot easier for me, and probably
involve a lot less swearing at the computer.
I'm using both 64-bit and 32-bit computers, so I'd need both. Thanks so much
for your help, I really appreciate it.
Michael
Original comment by [email protected]
on 21 Feb 2011 at 5:12
from randomforest-matlab.
Hi Michael
Attached is the version that supports windows 32/64 with random seed based on
time(). It will print out random seed initialized in the command prompt.
Everything in the interface is same as before.
thanks!
Original comment by abhirana
on 21 Feb 2011 at 7:41
Attachments:
from randomforest-matlab.
You might have to install the vc+ 2010 redistributables.
(32-bit)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a
423-37bf0912db84
and
(64-bit)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=bd512d9e-43c8-4655-8
1bf-9350143d5867
long story short, the 32-bit version was compiled using vc+ 2010 + matlab 2010b
and the 64-bit with vc+ 2008 + matlab 2009a
Original comment by abhirana
on 21 Feb 2011 at 7:46
from randomforest-matlab.
That worked perfectly. Thanks so much for all of your help, I really
appreciate it.
Michael
Original comment by [email protected]
on 21 Feb 2011 at 10:02
from randomforest-matlab.
[deleted comment]
from randomforest-matlab.
hi,
your code is very useful. thanks for sharing.
i am using 5-fold cross validation, (although i read about the internal oob
error rate, that is similar to cross validation).
Although, I have fixed the seed (global seed setting), but using multiple runs
i get a different output? i want to have same results each time. Keeping
everything else same, I want to play with the parameters.
regards,
Ihtesham.
Original comment by [email protected]
on 29 Nov 2012 at 12:12
from randomforest-matlab.
Ihtesham
what version of code are you using? svn or download?
i dont remember if the code in download has the srand() or not
http://code.google.com/p/randomforest-matlab/source/browse/trunk/RF_Class_C/src/
classRF.cpp#204
if you comment it out then you should get reproducible values
Original comment by abhirana
on 29 Nov 2012 at 7:05
from randomforest-matlab.
i am using the downloaded version. (i search and it doesn't contain the call to
srand function), but still i'm getting different results for multiple runs... I
am using the following code for my 5 fold cross validation to reset the global
seed. (matlab code)
stream = RandStream.getGlobalStream;
reset(stream);
CVO=cvpartition(Labels,'kfold',5);
Original comment by [email protected]
on 29 Nov 2012 at 12:40
from randomforest-matlab.
@ihtesham
attached code will give you reproducible code. All what is changed from the
uploaded version is recompiling the code with a fixed seed (both for
classifcation and regression, changed two lines which said seedMT(2*rand()+1)
to seedMT(77) )
do tell me if you have any issues.
Original comment by abhirana
on 11 Dec 2012 at 11:11
Attachments:
from randomforest-matlab.
Related Issues (20)
- weak learner HOT 1
- Compiling on Mac Lion HOT 6
- Compiled mexmaci64 for OSX 10.8.2 (Mountain Lion) HOT 2
- about the unbalanced data HOT 32
- Segmentation violation problem HOT 2
- Hierarchical sampling of data? HOT 3
- memory leak in HOT 1
- probability of classes for highly skewed dataset HOT 2
- Feature Normalization HOT 1
- sampsize problem
- score values from random forest HOT 1
- MATLAB crashes after tens of thousands runs !! HOT 3
- Compilation Problems with Matlab 2014a on Mac HOT 7
- How to get individual tree predictions for regression HOT 2
- use library (gcc) in matlab and error with compile of mex HOT 1
- NaN data HOT 4
- multivariate label output in regression analysis
- Matlab (randomly) crash after a number of runs HOT 5
- Directions for Bagging Regression HOT 2
- Quantifying Fractal Dimension HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from randomforest-matlab.