TorchLean API

NN.Spec.Module.DecisionTree

Decision Trees (Small Spec-Only Baseline) #

This file is small on purpose: it provides a pure decision tree datatype and an evaluator. It is a standalone baseline and does not use the tensor/module APIs.

Why include it here?

If you're thinking in the Python ecosystem: this is not an nn.Module-style component. It is closer to a symbolic scikit-learn style decision tree, except we keep it fully pure and explicit.

References / analogies:

inductive DecisionTree (α : Type) :

A small decision tree datatype (spec-only baseline).

node feature left right branches on decisionFn feature.

Instances For
    def evaluate {α : Type} (tree : DecisionTree α) (decisionFn : StringBool) :
    α

    Evaluate a decision tree using a Boolean predicate for each feature name.

    Instances For