Adding parameter and value pair in fitcdiscr for QDA classifier
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Lee Kai Sin
el 12 de Dic. de 2020
Respondida: Aditya Patil
el 21 de Dic. de 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 comentarios
Respuesta aceptada
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.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Discriminant Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!