Is it possible to run the classification learner app in a loop?
Mostrar comentarios más antiguos
I want my classification learner app to run with some generted data , but I keep having to do this again and again. Is there a way to run it with the generated data input using all classifiers and specifying the amount of cross-validation and finally export the results of all the classifier everytime I run.
1 comentario
Shairyar Malik
el 17 de Dic. de 2021
No one answered yet? I have the same question?
Respuestas (1)
yes,sir,just as
method,we can see
clc; clear all; close all;
warning off all;
x = [1 1 1 1 2 2 2 2 3 3 3 3];
y = categorical(["dog" "dog" "dog" "dog" "cat" "cat" "cat" "cat" "bird" "bird" "bird" "bird"]);
funcs = {@fitcknn @fitcecoc @fitctree};
n_funcs_given = numel(funcs);
A = cell(1,n_funcs_given);
B = cell(1,n_funcs_given);
% loop for every model method
for i = 1:n_funcs_given
% model fit
A{i} = funcs{i}(x(:),y(:));
% cross val
crossval_i = crossval(A{i});
B{i} = kfoldLoss(crossval_i);
end
A
B
1 comentario
Shairyar Malik
el 30 de Dic. de 2021
Many thanks, yanqi liu
Categorías
Más información sobre Image Data Workflows en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!