Adding parameter and value pair in fitcdiscr for QDA classifier
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Lee Kai Sin
il 12 Dic 2020
Risposto: Aditya Patil
il 21 Dic 2020
MdlQuadratic = fitcdiscr(QDAinputtrain,QDAtargettrain,'DiscrimType','quadratic','KFold',kfold);
outputtest = predict(MdlQuadratic,QDAinputtest);
Hi guys, the above is the code that I modify in order to test the effect of KFold value on the classification performance of the QDA classifier.
Hoever, the below error pops out.
Error using predict (line 84)
No valid system or dataset was specified.
Could someone help me in this?
0 Commenti
Risposta accettata
Aditya Patil
il 21 Dic 2020
Passing KFold to any classification model creates a ClassificationPartitionedModel, which is a set of multiple models. As such, one cannot call predict on it. Instead, you can use kfoldPredict function, which gives you the classification accuracy on the training partition for each of the model. For example,
load fisheriris.mat
mdl = fitcdiscr(meas, species, 'DiscrimType', 'quadratic', 'KFold', 4);
kfoldPredict(mdl)
If you want to predict on test dataset, train a separate model with same parameters, except for KFold, and then use predict on the test dataset.
The error message is a known issue, and might be fixed in any of the upcoming releases.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Naive Bayes in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!