You are here: Symbol Reference > Classifier Namespace > Types > Classifier.TOnClassifyTest Type
Data Miner
ContentsIndex
PreviousUpNext
Classifier.TOnClassifyTest Type

Event type used to determine classification accuracy.

Pascal
TOnClassifyTest = procedure (Sender: TObject; var Succes: double) of object;

Event used by TClassifier object to test the classification accuracy. The method needs to test the accuray of the classification and return result in the Success parameter. The following example shows the typical pattern, how this event is to be implemented: 

 

var i, k: Integer;
begin
    k := 0;
    for i := 0 to Length(Examples)-1 do
    begin
        if Examples[i].ClassIndex = NaiveBayes1.Classify(Examples[i].Discrete, Examples[i].Float) then Inc(k);
    end;
    Success := k/Length(Examples);
end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!