How can I change the properties of a classification model template?

4 vues (au cours des 30 derniers jours)
Josef Christian
Josef Christian le 14 Juin 2016
Commenté : Josef Christian le 16 Juin 2016
I want to programmatically change the properties of an existing classification model template. This would be useful in a parameter tuning task.
% for example lets create an SVM template
modelTemplate = templateSVM('KernelFunction', 'linear', 'KernelScale', 1,'BoxConstraint', 1, 'Standardize', 0);
disp(modelTemplate) % it is possible to see the properties in the command window
modelTemplate.BoxConstraint = 100; %but if I am trying to read or change one of the properties I get the following messages:
No public property BoxConstraint exists for class classreg.learning.FitTemplate.
Error in classreg.learning.internal.DisallowVectorOps/subsasgn (line 33) [varargout{1:nargout}] = builtin('subsasgn',this,s,data);
No appropriate method, property, or field 'BoxConstraint' for class 'classreg.learning.FitTemplate'.
Error in classreg.learning.internal.DisallowVectorOps/subsref (line 21) [varargout{1:nargout}] = builtin('subsref',this,s);

Réponse acceptée

Ilya
Ilya le 15 Juin 2016
modelTemplate.ModelParams.BoxConstraint = 100;
This is undocumented and can change in a future release.

Plus de réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by