Home > @DecisionTreeClassifier > computeOutputs.m

computeOutputs

PURPOSE ^

function [outs] = computeOutputs(cl, examples)

SYNOPSIS ^

function [outs, prop] = computeOutputs(cl, examples)

DESCRIPTION ^

 function [outs] = computeOutputs(cl, examples)
   computes the classification outputs for the given examples

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [outs, prop] = computeOutputs(cl, examples)
0002 % function [outs] = computeOutputs(cl, examples)
0003 %   computes the classification outputs for the given examples
0004 
0005 if ~cl.isTrained
0006     error('Decision Tree Classifier is not trained');
0007 end
0008 
0009 %% Hanlde Global Training Examples if Defined
0010 global trainingExamples
0011 if isempty(examples),
0012     if isempty(trainingExamples),
0013         outs = [];
0014         return;
0015     else
0016         if nargin < 3,
0017             examples = trainingExamples;
0018         else
0019             if iscell(trainingExamples),
0020                 examples = trainingExamples(indxs);
0021             else
0022                 examples = trainingExamples(indxs, :);
0023             end
0024         end
0025     end
0026 else
0027     if isempty(trainingExamples),
0028         clear global trainingExamples
0029     else
0030         clear trainingExamples
0031     end
0032 end
0033 
0034 %% Handle Cell Arrays
0035 if iscell(examples),
0036     examples = cell2mat(examples);
0037 end
0038 
0039 %% Compute Outs
0040 [outs, prop] = cl.trainedCl.predict(examples);
0041

Generated on Sun 29-Sep-2013 01:25:24 by m2html © 2005