helloide / randomforest-matlab

Automatically exported from code.google.com/p/randomforest-matlab
0 stars 0 forks source link

using this code in c# #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, 
I want to run this code c#,
I don't have knowledge in matlab, I am using dot.net
and I don't have matlab installed,but I can install it if necessary(I'm 
student), Can you please Help me out what steps I need to do in order to make 
it work .

Thank's

Original issue reported on code.google.com by brea...@gmail.com on 12 Apr 2011 at 4:43

GoogleCodeExporter commented 8 years ago
Hi

sorry i dont know how you will be able to link c code in this package with c#. 
what you can do is call the C side of the code in C and pass on whatever fields 
are required.

what you can do is take a look at this file 
http://code.google.com/p/randomforest-matlab/source/browse/trunk/RF_Class_C/src/
twonorm_C_wrapper.cpp and model your data to fit the code. I know its a very 
basic code and you might have to write code to extract the required fields like 
if you want to know feature importance, etc. I can help you out with that.

on line 62, 
http://code.google.com/p/randomforest-matlab/source/browse/trunk/RF_Class_C/src/
twonorm_C_wrapper.cpp#62 i set in the dataset size. cols is number of features 
and rows is the number of examples.

from 99-139 of the same code i read in the data
the X and Y data is represented in a file 

the filename are set at line 88 
http://code.google.com/p/randomforest-matlab/source/browse/trunk/RF_Class_C/src/
twonorm_C_wrapper.cpp#88

X data is 1 example per line and each feature/variable is separated by spaces. 
similarly Y data is 1 example per line, the same format is for regression.

the main program is then called at line 259 and the output labels are printed 
at line 267. 

i know this might be not enough to get a hang of how things are working but it 
may be a start. do tell me if you have any questions.

Original comment by abhirana on 12 Apr 2011 at 5:18