MATLAB: KNN hyperparameters optimisation – How not to show plots

hyperparametersknnleaningmachineoptimizationStatistics and Machine Learning Toolbox

This doesn't work… Can you please help me how to write the option correctly ?
classificationKNN = fitcknn(...
predictors, ...
response, ...
'OptimizeHyperparameters','auto',...
'HyperparameterOptimizationOptions','Showplots',false);
Grazie mille !

Best Answer

The 'HyperparameterOptimizationOptions' value must be a structure. Like this:
myopts.ShowPlots = false;
myresult = fitcknn(...
predictors, ...
response, ...
'OptimizeHyperparameters','auto',...
'HyperparameterOptimizationOptions',myopts);
Alan Weiss
MATLAB mathematical toolbox documentation
Related Question