class documentation

Undocumented

Static Method best_binary_stump Undocumented
Static Method best_stump Undocumented
Static Method binary_stump Undocumented
Static Method leaf Undocumented
Static Method stump Undocumented
Static Method train No summary
Method __init__ No summary
Method __str__ Undocumented
Method classify No summary
Method error Undocumented
Method labels No summary
Method pretty_format Return a string containing a pretty-printed version of this decision tree. Each line in this string corresponds to a single decision tree node or leaf, and indentation is used to display the structure of the decision tree.
Method pseudocode Return a string representation of this decision tree that expresses the decisions it makes as a nested set of pseudocode if statements.
Method refine Undocumented
Instance Variable _decisions Undocumented
Instance Variable _default Undocumented
Instance Variable _fname Undocumented
Instance Variable _label Undocumented

Inherited from ClassifierI:

Method classify_many Apply self.classify() to each element of featuresets. I.e.:
Method prob_classify No summary
Method prob_classify_many Apply self.prob_classify() to each element of featuresets. I.e.:
@staticmethod
def best_binary_stump(feature_names, labeled_featuresets, feature_values, verbose=False): (source)

Undocumented

@staticmethod
def best_stump(feature_names, labeled_featuresets, verbose=False): (source)

Undocumented

@staticmethod
def binary_stump(feature_name, feature_value, labeled_featuresets): (source)

Undocumented

@staticmethod
def leaf(labeled_featuresets): (source)

Undocumented

@staticmethod
def stump(feature_name, labeled_featuresets): (source)

Undocumented

@staticmethod
def train(labeled_featuresets, entropy_cutoff=0.05, depth_cutoff=100, support_cutoff=10, binary=False, feature_values=None, verbose=False): (source)
Parameters
labeled_featuresetsUndocumented
entropy_cutoffUndocumented
depth_cutoffUndocumented
support_cutoffUndocumented
binaryIf true, then treat all feature/value pairs as individual binary features, rather than using a single n-way branch for each feature.
feature_valuesUndocumented
verboseUndocumented
def __init__(self, label, feature_name=None, decisions=None, default=None): (source)
Parameters
labelThe most likely label for tokens that reach this node in the decision tree. If this decision tree has no children, then this label will be assigned to any token that reaches this decision tree.
feature_nameThe name of the feature that this decision tree selects for.
decisionsA dictionary mapping from feature values for the feature identified by feature_name to child decision trees.
defaultThe child that will be used if the value of feature feature_name does not match any of the keys in decisions. This is used when constructing binary decision trees.
def __str__(self): (source)

Undocumented

def classify(self, featureset): (source)
Returns
labelthe most appropriate label for the given featureset.
def error(self, labeled_featuresets): (source)

Undocumented

def labels(self): (source)
Returns
list of (immutable)the list of category labels used by this classifier.
def pretty_format(self, width=70, prefix='', depth=4): (source)

Return a string containing a pretty-printed version of this decision tree. Each line in this string corresponds to a single decision tree node or leaf, and indentation is used to display the structure of the decision tree.

def pseudocode(self, prefix='', depth=4): (source)

Return a string representation of this decision tree that expresses the decisions it makes as a nested set of pseudocode if statements.

def refine(self, labeled_featuresets, entropy_cutoff, depth_cutoff, support_cutoff, binary=False, feature_values=None, verbose=False): (source)

Undocumented

_decisions = (source)

Undocumented

_default = (source)

Undocumented

Undocumented

Undocumented