Code covered by the BSD License  

Highlights from
Discriminant Analysis Programme

image thumbnail
from Discriminant Analysis Programme by Bartolomeu Rabacal
Discrimination and Classification of data to and from groups with classical/robust estimation

plotClassification(m_model, classificationList, classifyRuleCoefList, m_dap, m_method)
function plotClassification(m_model, classificationList, classifyRuleCoefList, m_dap, m_method)

% Plots the classified data along with discrimination regions

figureTitle = sprintf('Data Classification of Classify Sample: %s Model/%s Method', upper(m_model), m_method);
figure('Name', figureTitle, 'NumberTitle','off')

rowCarry = 0;
for i = 1:m_dap.constants.numGrp
    for j = 1:size(classificationList{i},2)
        group{j + rowCarry,1} = ['Group ', num2str(i)];
        VAR1(j + rowCarry) = m_dap.datasets.classifySample(classificationList{i}(j),1);
        VAR2(j + rowCarry) = m_dap.datasets.classifySample(classificationList{i}(j),2);
    end
    rowCarry = rowCarry + size(classificationList{i},2);
    groupLegendNames{i} = ['Group ', num2str(i)];
end

gscatter(VAR1, VAR2, group, 'rgymcwkb', 'vo^sdph<>.+*',[],'off');
legend(groupLegendNames, -1)

xyLim = [min(VAR1) max(VAR1) min(VAR2) max(VAR2)];
xyInc = [0.5 0.5];

plotClassificationBoundaries(m_model, m_dap, classifyRuleCoefList, xyLim, xyInc);

xlabel('VAR1')
ylabel('VAR2')
title('{\bf Data Classification with Modeled Group Concentration Boundaries}')

Contact us at files@mathworks.com