def get_learner_parameters(self):
        from Orange.widgets.report import plural_w

        items = OrderedDict()
        items["Pruning"] = (", ".join(s for s, c in (
            (
                plural_w("at least {number} instance{s} in leaves",
                         self.min_leaf),
                self.limit_min_leaf,
            ),
            (
                plural_w(
                    "at least {number} instance{s} in internal nodes",
                    self.min_internal,
                ),
                self.limit_min_internal,
            ),
            ("maximum depth {}".format(self.max_depth), self.limit_depth),
        ) if c) or "None")
        if self.limit_majority:
            items["Splitting"] = ("Stop splitting when majority reaches %d%% "
                                  "(classification only)" %
                                  self.sufficient_majority)
        items["Binary trees"] = ("No", "Yes")[self.binary_trees]
        return items
Beispiel #2
0
 def get_learner_parameters(self):
     from Orange.widgets.report import plural_w
     items = OrderedDict()
     items["Pruning"] = ", ".join(s for s, c in (
         (plural_w("at least {number} instance{s} in leaves",
                   self.min_leaf), self.limit_min_leaf),
         (plural_w("at least {number} instance{s} in internal nodes",
                   self.min_internal), self.limit_min_internal),
         ("maximum depth {}".format(self.max_depth), self.limit_depth)
     ) if c) or "None"
     if self.limit_majority:
         items["Splitting"] = "Stop splitting when majority reaches %d%% " \
                              "(classification only)" % \
                              self.sufficient_majority
     items["Binary trees"] = ("No", "Yes")[self.binary_trees]
     return items