Authored by Francois Tadel

Save classifier after computation

... ... @@ -71,10 +71,11 @@ end
trainBase = load(trainBaseFile);
% Train the classifier
trainedClassifier = ImaGIN_trainClassifier(trainBase.predictors, trainBase.response);
% Save results
save(trainedFile, '-struct', 'trainedClassifier');
% Otherwise, load the trained classifier
else
trainedMat = load(trainedFile);
trainedClassifier = trainedMat.trainedClassifier;
trainedClassifier = load(trainedFile);
end
% Predict new dataset
... ... @@ -141,7 +142,7 @@ end
mkdir(figDir);
end
close all;
% close all;
Size = 8; % Number of channels per screenshot
n_c = size(D,1);
... ...
... ... @@ -44,8 +44,6 @@ function [trainedClassifier, validationAccuracy] = ImaGIN_trainClassifier(predic
% Extract predictors and response
predictorNames = {'ch_xcorr', 'ch_var', 'ch_dev', 'ch_ampl', 'ch_grad', 'ch_kurt', 'ch_hurs'};
predictorNames
% Train a classifier
% This code specifies all the classifier options and trains the classifier.
classificationEnsemble = fitensemble(...
... ...