Exemple #1
0
    def get_trees(self):
        """Get the tree adapters in the random forest."""
        if len(self._adapters) > 0:
            return self._adapters
        if len(self._trees) < 1:
            return self._adapters

        self._adapters = [
            SklTreeAdapter(tree.tree_, self._domain, self._adjust_weight)
            for tree in self._trees
        ]
        return self._adapters
Exemple #2
0
 def _get_tree_adapter(self, model):
     if isinstance(model, SklModel):
         return SklTreeAdapter(model)
     return TreeAdapter(model)
 def _get_tree_adapter(self, model):
     return SklTreeAdapter(
         model.tree,
         model.domain,
         adjust_weight=self.SIZE_CALCULATION[self.size_calc_idx][1],
     )