Related to Classification Learner App

2 次查看(过去 30 天)
Hello all, I am working on SVM classification. I had written the MATLAB code to train the SVM classifier using the line "Mdl_SVM = fitcsvm(feat_training,label_train);". Further, I am test the model using the line "Predic_label_SVM = predict(Mdl_SVM,feat_testing)" and plotted the desired result.
Also, I am trying to perform the same task using Classification learner app. However, my query is that I am getting different results using the two approach i.e., one with using "fitcsvm, predict" and classification learner app.
Any help in this regard will be highly appreciated.

采纳的回答

Drew
Drew 2024-2-6
Without seeing more details, there are many possible reasons for the difference between your CLI results and the Classification Learner results. Here are some ideas:
(1) Are you using the same datasets for both? If you are only using a training set and a test set at the CLI, without cross-validation, then you should be sure to look at the test set accuracy within the Classification Learner app. To do that, load the training data into the classification Learner app, start the session with your choice of hold-out validation or cross-validation, then train your model, then load the test data, then look at the results on the test data (not the validation results).
(2) Are the fitcsvm training parameters the same at the CLI and in Classification Learner? Prior to model training, check the parameters within Classification Learner using the model summary tab.
For more detailed guidance, attached your data (or a subset thereof) and your corresponding results.
If this answer helps you, please remember to accept the answer.
  2 个评论
chaaru datta
chaaru datta 2024-2-6
Thank u sir for ur detailed response....
the cyclist
the cyclist 2024-2-6
In addition to the above, note that fitcsvm is an algorthm that has inherent randomness built in, so that could be the only reason for the difference. Even calling fitcsvm two times from the command window could lead to different results. (How different the results are will depend on many factors, including the sample size.)
To get reproducible results in the command window, you can see the random number generator seed using
rng default
before the call to fitcsvm.
I'm not sure if/how you can do the same thing for the Classification Learner.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Classification Learner App 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by