Total members 11892 |It is currently Fri Oct 18, 2024 8:44 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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 .



_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  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     -  
 KFold Cross-validation Random Forest Binary Classification     -  
 Weka java code for Random Forest Cross Validation     -  
 naive Bayes classifier in MATLAB     -  
 Random To File     -  
 Random to File     -  
 php Random quote     -  



Topic Tags

Matlab Classifier
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com