classifier
조회 수: 6 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Greg Heath
2012년 4월 11일
For Neural Net classification, see the documentation for patternnet and the classification demo example.
Hope this helps.
Greg
댓글 수: 0
추가 답변 (4개)
Agustin
2014년 11월 17일
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.
댓글 수: 0
Ilya
2012년 4월 7일
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.
댓글 수: 2
Greg Heath
2012년 4월 11일
See the pattern recognition and classification demos in the Neural Network Toolbox.
Hope this helps.
Greg
Ilya
2012년 4월 10일
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.
댓글 수: 2
Ilya
2012년 4월 11일
First, this thread has become convoluted. If you want to post another question, I suggest that you post it as a new question, not as an answer to your own old question.
Second, I suggested that you look at function crossval, not crossvalind. You can cross-validate using crossvalind too, but crossval offers an API that reduces the amount of code you need to write.
Third, whether you choose to use crossval or crossvalind, please take a look at the examples and follow them closely. In particular, 2nd example for crossval here http://www.mathworks.com/help/toolbox/stats/crossval.html shows what you need to do. You would need to replace the function handle classf in that example with a function which has two lines of code in it: 1) Train a TreeBagger on Xtrain and Ytrain, and 2) Predict labels for Xtest using the trained TreeBagger.
Richard Willey
2012년 4월 11일
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.
댓글 수: 3
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification Ensembles에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!