i have a dataset of 100x6,i want to classify these and find the accuracy using random forest and mlp ,i have classifeid using svm and knn,but dont know how to do with MLP and random forest ,please do help
No products are associated with this question.
For Neural Net classification, see the documentation for patternnet and the classification demo example.
Hope this helps.
If you have Statistics Toolbox and MATLAB 9a or later, you can use TreeBagger. Please read the documentation and take a look at the examples. Follow up with a specific question if something remains unclear.
For MLP, take a look at the Neural Network Toolbox.
You can use out-of-bag error as an unbiased estimate of the generalization error. Train TreeBagger with 'oobpred' set to 'on' and call oobError method.
If you insist on using cross-validation, do 'doc crossval' and follow examples there.
I did a webinar a couple years titled:
"Computational Statistics: An Introduction to Classification with MATLAB". You can watch the recorded webinar online. The demo code and data sets are available on MATLAB Central.
I have written the following code to do cross-validation using TreeBagger (I use the fisheriris dataset):
load fisheriris X = meas; y = species;
%data partition cp = cvpartition(y,'k',10); %10-folds
%prediction function classF = @(XTRAIN,ytrain,XTEST)(predict(TreeBagger(50,XTRAIN,ytrain),XTEST));
&missclassification error missclasfError = crossval('mcr',X,y,'predfun',classF,'partition',cp);
I hope it is useful.