-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathREADME.txt
43 lines (32 loc) · 1.84 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Random Forest for Matlab
This toolbox was written for my own education and to give me a chance to explore the models a bit.
It is NOT intended for any serious applications and it does not NOT do many of things you would
want a mature implementation to do, like leaf pruning. If you wish to use a strong implementation
I recommend Scikit Learn / Python. For Matlab I do not really have a recommendation.
---------------------------------------------------------------------------
Usage:
Random Forests for classification: (see demo for more)
opts.classfierID= [2, 3]; % use both 2D-linear weak learners (2) and conic (3)
m= forestTrain(X, Y, opts);
yhat = forestTest(m, X);
fprintf('Training accuracy = %.2f\n', mean(yhat==Y));
---------------------------------------------------------------------------
More info:
Currently contains random forests.
The Random Forest code is not industrial strength implementation.
Inspired by MSR's recent work on Random Forests:
https://research.microsoft.com/apps/pubs/default.aspx?id=155552
See http://cs.stanford.edu/~karpathy/randomForestSpiral.png
for results on spiral using 2-D linear weak learners. (Code that generates
the image is in forestdemo.m)
---------------------------------------------------------------------------
Adding your own weak learners in Ranfom Forests:
It is fairly easy to add your own weak learners. Modify:
weakTrain.m: add another elseif statement for classf variable, and put in
code for your weak learner. Store all variables you need during
test time in modelCandidate
weakTest.m: add another elseif for your classifier, and implement the decision
procedure, using variables you stored inside model.
Now just include your new classifier when setting opts.classfierID!
---------------------------------------------------------------------------
BSD Licence.