nltk.DecisionTreeClassifier

class nltk.DecisionTreeClassifier(label, feature_name=None, decisions=None, default=None)[source]

Methods

__init__(label[, feature_name, decisions, ...])
param label:The most likely label for tokens that reach
best_binary_stump(feature_names, ...[, verbose])
best_stump(feature_names, labeled_featuresets)
binary_stump(feature_name, feature_value, ...)
classify(featureset)
classify_many(featuresets) Apply self.classify() to each element of featuresets.
error(labeled_featuresets)
labels()
leaf(labeled_featuresets)
pretty_format([width, prefix, depth]) Return a string containing a pretty-printed version of this decision tree.
prob_classify(featureset)
return:a probability distribution over labels for the given
prob_classify_many(featuresets) Apply self.prob_classify() to each element of featuresets.
pseudocode([prefix, depth]) Return a string representation of this decision tree that expresses the decisions it makes as a nested set of pseudocode if statements.
refine(labeled_featuresets, entropy_cutoff, ...)
stump(feature_name, labeled_featuresets)
train(labeled_featuresets[, entropy_cutoff, ...])
param binary:If true, then treat all feature/value pairs as

Attributes

unicode_repr() <==> repr(x)