% Design a quadratic classifier vsdOpt=vsdOptSet; % ====== Load DS.mat fprintf('Loading DS.mat...\n'); load DS.mat load bestInputIndex.mat DS2=DS; % DS2 is DS after input selection and normalization DS2.input=DS2.input(bestInputIndex, :); % Use the selected features DS2.inputName=DS2.inputName(bestInputIndex); % Update the input names based on the selected features if vsdOpt.useInputNormalize [DS2.input, mu, sigma]=inputNormalize(DS2.input); % Input normalization end priors=classDataCount(DS2); % Take data count of each class as the class probability % ====== Down sample the training data fprintf('Down sample DS with a rate of %d...\n', vsdOpt.downSampleRate); DS2.input=DS2.input(:, 1:vsdOpt.downSampleRate:end); DS2.output=DS2.output(:, 1:vsdOpt.downSampleRate:end); % ====== Qudratic classifier [qcPrm, recogRate]=qcTrain(DS2, priors, 1); % Classifier design based on quadratic classifiers. Also plot the data distribution fprintf('Recognition rate = %f%%\n', recogRate*100); fprintf('Saving classifier-related info to classifierPrm.mat...\n'); if vsdOpt.useInputNormalize save qcPrm.mat qcPrm bestInputIndex mu sigma else save qcPrm.mat qcPrm bestInputIndex end if length(bestInputIndex)==2 decBoundaryPlot; end