Switch to full style
General MATLAB code examples.
Post a reply

random forest algorithm classifier

Tue Apr 03, 2012 1:17 am

In this code we show you how to run random forest algorithm classifier in MATLAB :

Code:

TreeObject
=TreeBagger(50,TrainData,class,'method ','classification','NVarToSample','all');
 


First parameter is the number of decision tree to use , TrainData is the training data vector , class is the label for each vector, method parameter is used to differ between regression and classification training. NVarToSample used to set the algorithm to "random forest" .

Now after training , how to use this object for classification :
Code:
[YFIT,scores] = predict(TreeObject,TestVector)
 

YFIT : label the high fitted class label.
scores : contain the score for each label .



Post a reply
  Related Posts  to : random forest algorithm classifier
 Get the important variables of random forest classifier     -  
 Cost Sensitive Classifier Random Forest Java in weka     -  
 Random Search for tuning classifier parameters     -  
 Random Forest Classification (Binary )- Supervised Learning     -  
 Weka java code for Random Forest Cross Validation     -  
 KFold Cross-validation Random Forest Binary Classification     -  
 naive Bayes classifier in MATLAB     -  
 php Random quote     -  
 php Random image     -  
 Random To File     -  

Topic Tags

Matlab Classifier