TLinearClassifier Class

TComponentTClassifierTStatisticClassifierTLinearClassifier

type TLinearClassifier = class(TStatisticClassifier);

Implementation of the "Linear classifier" classifier.

The classifier is very similar to the Naive Bayes, with several important differences. It can natively process real valued attributes, it is invariant to the prior probability and works well even, if there is only one learned example per class. Classification accuracy is close to the one of the Naive Bayes.

Properties

NameTypeDescription
AttributeEnabledbooleanSet the value at index to True/False, to enable/disable the corresponding attribute.
ClassesTLClassesListPointer to list of classes with attribute descriptions and stored learned data.
OnFirstRecordTNotifyEventCalled by LearnData method and K-NN to request the positioning to the first record.
OnIndexNextRecordTIndexNextRecordCalled by LearnData method and K-NN to browse through the learn dataset.
OnLastRecordTNotifyEventCalled by LearnData method and K-NN when the last record is fetched.
OnNameNextRecordTNameNextRecordCalled by LearnData method and K-NN to browse through the learn data set.
OnPopPositionTPopBookmarkCalled by LearnData method and K-NN to restore the current position of the dataset.
OnPushPositionTPushBookmarkCalled by LearnData method and K-NN to save the current position of the dataset.
RejectProbabilitydoubleIf the response of all classes is below RejectProbability the example will not be classified to any of the known classes.

Methods

NameDescription
AssignAttributeStateCopies the attribute Enabled fields from Source.
AttributeQualityReturns an array of attribute indexes sorted by quality.
ClassesName
Classify
ClassifyResponse
ClassifyTestPerforms the classification on the test data, by calling the OnClassifyTest event.
ClassIndex
Clear
CreateCreate the component.
Destroy
DisableAttributesDisable real valued and discrete attributes for all classes.
DisableDiscreteAttributesDisable discrete attributes for all classes.
DisableFloatAttributesDisable real valued attributes for all classes.
EnableAttributesEnable real valued and discrete attributes for all classes.
EnableDiscreteAttributesEnable discrete attributes for all classes.
EnableFloatAttributesEnable real valued attributes for all classes.
EntropyReturns the average information entropy.
Learn
LearnDataCall this method to perform the learn operation on the learn data.
LearnIndex
LoadFromFileLoad the component from file named FileName.
LoadFromStream
MaxDiscreteEntropyReturns the maximum entropy of the discrete attribute at AttributeIndex.
MaxEntropyReturns the maximum entropy found to be of the attribute at Index.
MaxFloatEntropyReturns the maximum entropy of the real valued attribute at AttributeIndex.
MaxPriorProbability
MissingFloatNumberReturns numerical representation of MissingFloatValue.
PostPrunePruning disables some attributes, to improve classification accuracy.
PrePrunePruning disables some attributes, to improve classificaiton accuracy.
PrunePerforms pre-pruning and post-pruning and enables only those attributes giving best classification accuracy towards the test dataset.
Reset
SaveToFileSave the component to file named FileName.
SaveToStream
SoftReset
SortIndexRecordSort an array of TIndexRecords.