How to use loss() function in SVM trained model
이전 댓글 표시
I have 40*5 matrix 'tsetALLstd.CSV', file 1 to 4 columns represent as a predictor and 5th column represents response variables. I have attached file in here, I used machine learning toolbox for train SVM model using that 'tsetALLstd.CSV' file and I export it to my Matlab workspace.I need to calculate classification error in SVM how should I do it?

답변 (1개)
Hi
here you find an example with step by step how to for your problem:
Best regards
Stephan
댓글 수: 5
Asanka Dewappriya
2018년 5월 5일
Stephan
2018년 5월 5일
In your case the name of the 5th column
Asanka Dewappriya
2018년 5월 5일
Stephan
2018년 5월 6일
Please send your .mat file containing O and trained model. Also please send your code you have tried.
Best regards
Stephan
Hi,
try with attached file...-

Load this file into Workspace and then type:
>> SVMModel = fitcecoc(tsetALLstd, 'VarName5')
SVMModel =
ClassificationECOC
PredictorNames: {'VarName1' 'VarName2' 'VarName3' 'VarName4'}
ResponseName: 'VarName5'
CategoricalPredictors: []
ClassNames: [0.0 1.0 2.0 3.0]
ScoreTransform: 'none'
BinaryLearners: {6×1 cell}
CodingName: 'onevsone'
Properties, Methods
>> CV = crossval(SVMModel)
CV =
classreg.learning.partition.ClassificationPartitionedECOC
CrossValidatedModel: 'ECOC'
PredictorNames: {'VarName1' 'VarName2' 'VarName3' 'VarName4'}
ResponseName: 'VarName5'
NumObservations: 40
KFold: 10
Partition: [1×1 cvpartition]
ClassNames: [0.0 1.0 2.0 3.0]
ScoreTransform: 'none'
Properties, Methods
>> Model_loss = kfoldLoss(CV)
Model_loss =
0
Best regards
Stephan
카테고리
도움말 센터 및 File Exchange에서 Classification Ensembles에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

