object
c45_classifier
C4.5 decision tree learning algorithm. Builds a decision tree from a dataset object implementing the dataset_protocol protocol and provides predicates for exporting the learned tree as a list of predicate clauses or to a file. Supports both discrete and continuous attributes, handles missing values, and supports tree pruning.
logtalk_load(c45_classifier(loader))static, context_switching_callsPublic predicates
prune/5
Prunes a decision tree using pessimistic error pruning (PEP). This post-pruning method estimates error rates using the upper confidence bound of the binomial distribution with the given confidence factor and replaces subtrees with leaf nodes when doing so would not increase the estimated error. Pruning helps reduce overfitting and can improve generalization to unseen data.
staticprune(Dataset,Tree,ConfidenceFactor,MinInstances,PrunedTree)prune(+object_identifier,+classifier,+float,+positive_integer,-classifier) - oneinstantiation_errordomain_error(confidence_factor,ConfidenceFactor)domain_error(positive_integer,MinInstances)domain_error(classifier,Tree)domain_error(non_empty_dataset,Dataset)domain_error(class_values,ClassValues)domain_error(attribute_declarations,Attribute)existence_error(attribute,Attribute)
Confidence factor: The confidence factor must be a float in
(0.0, 0.5]so that the error estimate is an upper confidence bound. Lower values increase the estimated uncertainty. The default value is0.25.Minimum node population: A non-empty node with weighted population below this positive integer is replaced by its majority leaf. This does not require every leaf to meet the minimum. The default value is
2.Statistical basis: The pruning uses the upper confidence bound of the binomial distribution to estimate the true error rate.
prune/3
Prunes a decision tree using pessimistic error pruning (PEP) with default parameter values. Calls prune/5 with ConfidenceFactor = 0.25 and MinInstances = 2.
staticprune(Dataset,Tree,PrunedTree)prune(+object_identifier,+classifier,-classifier) - oneinstantiation_errordomain_error(classifier,Tree)domain_error(non_empty_dataset,Dataset)domain_error(class_values,ClassValues)domain_error(attribute_declarations,Attribute)existence_error(attribute,Attribute)
Default parameters: Uses a confidence factor of
0.25and minimum weighted node population of2. Existing leaves and empty branches are preserved.
Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)