':param binary: If true, then treat all feature/value pairs as
individual binary features, rather than using a single n-way
branch for each feature.'

@staticmethod
def train(labeled_featuresets, entropy_cutoff=0.05, depth_cutoff=100, support_cutoff=10, binary=False, feature_values=None, verbose=False):

    feature_names = set()
    for (featureset, label) in labeled_featuresets:
        for fname in featureset:
            feature_names.add(fname)
    if ((feature_values is None) and binary):
        feature_values = defaultdict(set)
        for (featureset, label) in labeled_featuresets:
            for (fname, fval) in featureset.items():
                feature_values[fname].add(fval)
    if (not binary):
        tree = DecisionTreeClassifier.best_stump(feature_names, labeled_featuresets, verbose)
    else:
        tree = DecisionTreeClassifier.best_binary_stump(feature_names, labeled_featuresets, feature_values, verbose)
    tree.refine(labeled_featuresets, entropy_cutoff, (depth_cutoff - 1), support_cutoff, binary, feature_values, verbose)
    return tree
