Borrar filtros
Borrar filtros

Adding parameter and value pair in fitcdiscr for QDA classifier

1 visualización (últimos 30 días)
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?

Respuesta aceptada

Aditya Patil
Aditya Patil el 21 de Dic. de 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.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by