covartech/PRT

prtDecisionMap

Closed this issue · 1 comments

What's the difference between

classifier = prtClassKnn + prtDecisionMap;

and

classifier = prtClassKnn;
classifier.internalDecider= prtDecisionMap; ???

Because I'm getting very different results in terms of classification between this 2...

Thanks

The following test code obtains the same results from both methods. Internal deciders are primarily used for plotting decision boundaries in an easy way. In almost all other cases it is preferable to use the + operator to form an algorithm.

I suspect your output mismatch is caused by other differences in the code.

Kenny

ds = prtDataGenMarysSimpleSixClass;

classifierPlusDecider = prtClassKnn + prtDecisionMap;
classifierInternalDecider = prtClassKnn('internalDecider',prtDecisionMap);

trainedPlus = train(classifierPlusDecider, ds);
trainedInternal = train(classifierInternalDecider, ds);

outPlus = run(trainedPlus, ds);
outInternal = run(trainedInternal, ds);

plot(1:outPlus.nObservations,outPlus.X,1:outInternal.nObservations,outInternal.X)
isequal(outPlus.X,outInternal.X) % Yields true