|
|
using | Base = DecisionTree< L, double > |
| |
|
using | LabelFormatter = std::function< std::string(L)> |
| |
|
using | ValueFormatter = std::function< std::string(double)> |
| |
|
using | CompareFunc = std::function< bool(const double &, const double &)> |
| |
| using | Unary = std::function< double(const double &)> |
| |
|
using | UnaryAssignment = std::function< double(const Assignment< L > &, const double &)> |
| |
|
using | Binary = std::function< double(const double &, const double &)> |
| |
| using | LabelC = std::pair< L, size_t > |
| |
| using | NodePtr = typename Node::Ptr |
| |
|
|
| AlgebraicDecisionTree (double leaf=1.0) |
| |
|
| AlgebraicDecisionTree (const Base &add) |
| |
| | AlgebraicDecisionTree (const L &label, double y1, double y2) |
| |
| | AlgebraicDecisionTree (const typename Base::LabelC &labelC, double y1, double y2) |
| |
| | AlgebraicDecisionTree (const std::vector< typename Base::LabelC > &labelCs, const std::vector< double > &ys) |
| |
| | AlgebraicDecisionTree (const std::vector< typename Base::LabelC > &labelCs, const std::string &table) |
| |
| template<typename Iterator > |
| | AlgebraicDecisionTree (Iterator begin, Iterator end, const L &label) |
| |
| template<typename M > |
| | AlgebraicDecisionTree (const AlgebraicDecisionTree< M > &other, const std::map< M, L > &map) |
| |
| AlgebraicDecisionTree | operator+ (const AlgebraicDecisionTree &g) const |
| |
| AlgebraicDecisionTree | operator* (const AlgebraicDecisionTree &g) const |
| |
| AlgebraicDecisionTree | operator/ (const AlgebraicDecisionTree &g) const |
| |
| AlgebraicDecisionTree | sum (const L &label, size_t cardinality) const |
| |
| AlgebraicDecisionTree | sum (const typename Base::LabelC &labelC) const |
| |
|
void | print (const std::string &s="", const typename Base::LabelFormatter &labelFormatter=&DefaultFormatter) const |
| | print method customized to value type double.
|
| |
|
bool | equals (const AlgebraicDecisionTree &other, double tol=1e-9) const |
| | Equality method customized to value type double.
|
| |
|
| void | print (const std::string &s, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter) const |
| | GTSAM-style print. More...
|
| |
|
bool | equals (const DecisionTree &other, const CompareFunc &compare=&DefaultCompare) const |
| |
|
|
bool | empty () const |
| | Check if tree is empty.
|
| |
| bool | operator== (const DecisionTree &q) const |
| |
| const double & | operator() (const Assignment< L > &x) const |
| |
| void | visit (Func f) const |
| | Visit all leaves in depth-first fashion. More...
|
| |
| void | visitLeaf (Func f) const |
| | Visit all leaves in depth-first fashion. More...
|
| |
| void | visitWith (Func f) const |
| | Visit all leaves in depth-first fashion. More...
|
| |
|
size_t | nrLeaves () const |
| | Return the number of leaves in the tree.
|
| |
| X | fold (Func f, X x0) const |
| | Fold a binary function over the tree, returning accumulator. More...
|
| |
| std::set< L > | labels () const |
| |
| DecisionTree | apply (const Unary &op) const |
| |
| DecisionTree | apply (const UnaryAssignment &op) const |
| | Apply Unary operation "op" to f while also providing the corresponding assignment. More...
|
| |
| DecisionTree | apply (const DecisionTree &g, const Binary &op) const |
| |
| DecisionTree | choose (const L &label, size_t index) const |
| |
| DecisionTree | combine (const L &label, size_t cardinality, const Binary &op) const |
| |
| DecisionTree | combine (const LabelC &labelC, const Binary &op) const |
| |
| void | dot (std::ostream &os, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter, bool showZero=true) const |
| |
| void | dot (const std::string &name, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter, bool showZero=true) const |
| |
| std::string | dot (const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter, bool showZero=true) const |
| |
|
|
NodePtr | compose (Iterator begin, Iterator end, const L &label) const |
| |
template<typename L>
class gtsam::AlgebraicDecisionTree< L >
Algebraic Decision Trees fix the range to double Just has some nice constructors and some syntactic sugar TODO: consider eliminating this class altogether?
Retrieve all unique labels as a set.
Get (partial) labels by performing a visit.
This method performs a depth-first search to go to every leaf and records the keys assignment which leads to that leaf. Since the tree can be pruned, there might be a leaf at a lower depth which results in a partial assignment (i.e. not all keys are specified).
E.g. given a tree with 3 keys, there may be a branch where the 3rd key has the same values for all the leaves. This leads to the branch being pruned so we get a leaf which is arrived at by just the first 2 keys and their assignments.