Why is the Score Transform lost when using "saveCompactModel"?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 30 Nov. 2018
Bearbeitet: MathWorks Support Team
am 9 Jan. 2019
I simply modified the MATLAB fisheriris example at:
to add "fitSVMPosterior". As you can see in this example the score transform is lost after "loadCompactModel". Is there a reason it does not save the score transform for deployment?
Code example:
load fisheriris
inds = ~strcmp(species,'setosa');
X = meas(inds,:);
Y = species(inds);
Mdl = fitcsvm(X,Y);
MdlScore=fitSVMPosterior(Mdl);
saveCompactModel(MdlScore,'SVMIris');
And then when I do this,
loadCompactModel('SVMIris')
I get the following warning message:
Warning: Unable to restore ScoreTransform property. Call
fitSVMPosterior to fit posterior probabilities.
> In classreg.learning.classif.CompactClassificationSVM.fromStruct (line 296)
In classreg.coderutils.structToModel (line 50)
In loadCompactModel (line 30)
Akzeptierte Antwort
MathWorks Support Team
am 9 Jan. 2019
One of the limitations of using "saveCompactModel" to save an SVM model with capabilities to predict posterior probabilities is that "loadCompactModel" cannot restore the 'ScoreTransform' property to the MATLAB Workspace.
However, while preforming code generation, "loadCompactModel" is able to load the model along with the 'ScoreTransform' property at compile time within an entry function, and hence should function properly.
For more information on such limitations on various model objects while using "loadCompactModel", please refer to the documentation link below:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Classification Ensembles finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!