|
|
| DecisionTreeFactor () |
| Default constructor for I/O.
|
|
| DecisionTreeFactor (const DiscreteKeys &keys, const ADT &potentials) |
| Constructor from DiscreteKeys and AlgebraicDecisionTree.
|
|
| DecisionTreeFactor (const DiscreteKeys &keys, const std::vector< double > &table) |
| Constructor from doubles.
|
|
| DecisionTreeFactor (const DiscreteKeys &keys, const std::string &table) |
| Constructor from string.
|
|
template<class SOURCE > |
| DecisionTreeFactor (const DiscreteKey &key, SOURCE table) |
| Single-key specialization.
|
|
| DecisionTreeFactor (const DiscreteKey &key, const std::vector< double > &row) |
| Single-key specialization, with vector of doubles.
|
|
| DecisionTreeFactor (const DiscreteConditional &c) |
| Construct from a DiscreteConditional type.
|
|
|
bool | equals (const DiscreteFactor &other, double tol=1e-9) const override |
| equality
|
|
void | print (const std::string &s="DecisionTreeFactor:\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override |
| print
|
|
|
DecisionTreeFactor | apply (const DecisionTreeFactor &f, ADT::Binary op) const |
| Apply binary operator (*this) "op" f.
|
|
shared_ptr | combine (size_t nrFrontals, ADT::Binary op) const |
| Combine frontal variables using binary operator "op".
|
|
shared_ptr | combine (const Ordering &keys, ADT::Binary op) const |
| Combine frontal variables in an Ordering using binary operator "op".
|
|
std::vector< std::pair< DiscreteValues, double > > | enumerate () const |
| Enumerate all values into a map from values to double.
|
|
DiscreteKeys | discreteKeys () const |
| Return all the discrete keys associated with this factor.
|
|
DecisionTreeFactor | prune (size_t maxNrAssignments) const |
| Prune the decision tree of discrete variables.
|
|
|
void | dot (std::ostream &os, const KeyFormatter &keyFormatter=DefaultKeyFormatter, bool showZero=true) const |
| output to graphviz format, stream version
|
|
void | dot (const std::string &name, const KeyFormatter &keyFormatter=DefaultKeyFormatter, bool showZero=true) const |
| output to graphviz format, open a file
|
|
std::string | dot (const KeyFormatter &keyFormatter=DefaultKeyFormatter, bool showZero=true) const |
| output to graphviz format string
|
|
std::string | markdown (const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override |
| Render as markdown table.
|
|
std::string | html (const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override |
| Render as html table.
|
|
|
double | error (const HybridValues &values) const override |
| Calculate error for HybridValues x , is -log(probability) Simply dispatches to DiscreteValues version.
|
|
| DiscreteFactor () |
| Default constructor creates empty factor.
|
|
template<typename CONTAINER > |
| DiscreteFactor (const CONTAINER &keys) |
| Construct from container of keys.
|
|
virtual | ~DiscreteFactor () |
| Virtual destructor.
|
|
void | print (const std::string &s="DiscreteFactor\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override |
| print
|
|
double | error (const DiscreteValues &values) const |
| Error is just -log(value)
|
|
double | error (const HybridValues &c) const override |
| All factor types need to implement an error function.
|
|
virtual | ~Factor ()=default |
| Default destructor.
|
|
bool | empty () const |
| Whether the factor is empty (involves zero variables).
|
|
Key | front () const |
| First key.
|
|
Key | back () const |
| Last key.
|
|
const_iterator | find (Key key) const |
| find
|
|
const KeyVector & | keys () const |
| Access the factor's involved variable keys.
|
|
const_iterator | begin () const |
| Iterator at beginning of involved variable keys.
|
|
const_iterator | end () const |
| Iterator at end of involved variable keys.
|
|
size_t | size () const |
|
virtual void | printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const |
| print only keys
|
|
bool | equals (const This &other, double tol=1e-9) const |
| check equality
|
|
KeyVector & | keys () |
|
iterator | begin () |
| Iterator at beginning of involved variable keys.
|
|
iterator | end () |
| Iterator at end of involved variable keys.
|
|
| AlgebraicDecisionTree (double leaf=1.0) |
|
| AlgebraicDecisionTree (const Base &add) |
|
| AlgebraicDecisionTree (const Key &label, double y1, double y2) |
| Create a new leaf function splitting on a variable.
|
|
| AlgebraicDecisionTree (const typename Base::LabelC &labelC, double y1, double y2) |
| Create a new leaf function splitting on a variable.
|
|
| AlgebraicDecisionTree (const std::vector< typename Base::LabelC > &labelCs, const std::vector< double > &ys) |
| Create from keys with cardinalities and a vector table.
|
|
| AlgebraicDecisionTree (const std::vector< typename Base::LabelC > &labelCs, const std::string &table) |
| Create from keys and string table.
|
|
| AlgebraicDecisionTree (Iterator begin, Iterator end, const Key &label) |
| Create a range of decision trees, splitting on a single variable.
|
|
| AlgebraicDecisionTree (const AlgebraicDecisionTree< M > &other, const std::map< M, Key > &map) |
| Convert labels from type M to type L.
|
|
AlgebraicDecisionTree | operator+ (const AlgebraicDecisionTree &g) const |
| sum
|
|
AlgebraicDecisionTree | operator* (const AlgebraicDecisionTree &g) const |
| product
|
|
AlgebraicDecisionTree | operator/ (const AlgebraicDecisionTree &g) const |
| division
|
|
AlgebraicDecisionTree | sum (const Key &label, size_t cardinality) const |
| sum out variable
|
|
AlgebraicDecisionTree | sum (const typename Base::LabelC &labelC) const |
| sum out variable
|
|
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 .
|
|
| DecisionTree () |
| Default constructor (for serialization)
|
|
| DecisionTree (const Y &y) |
| Create a constant.
|
|
| DecisionTree (const L &label, const Y &y1, const Y &y2) |
| Create tree with 2 assignments y1 , y2 , splitting on variable label
|
|
| DecisionTree (const LabelC &label, const Y &y1, const Y &y2) |
| Allow Label+Cardinality for convenience.
|
|
| DecisionTree (const std::vector< LabelC > &labelCs, const std::vector< Y > &ys) |
| Create from keys and a corresponding vector of values.
|
|
| DecisionTree (const std::vector< LabelC > &labelCs, const std::string &table) |
| Create from keys and string table.
|
|
template<typename Iterator > |
| DecisionTree (Iterator begin, Iterator end, const L &label) |
| Create DecisionTree from others.
|
|
| DecisionTree (const L &label, const DecisionTree &f0, const DecisionTree &f1) |
| Create DecisionTree from two others.
|
|
template<typename X , typename Func > |
| DecisionTree (const DecisionTree< L, X > &other, Func Y_of_X) |
| Convert from a different value type.
|
|
template<typename M , typename X , typename Func > |
| DecisionTree (const DecisionTree< M, X > &other, const std::map< M, L > &map, Func Y_of_X) |
| Convert from a different value type X to value type Y, also transate labels via map from type M to L.
|
|
void | print (const std::string &s, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter) const |
| GTSAM-style print.
|
|
bool | equals (const DecisionTree &other, const CompareFunc &compare=&DefaultCompare) const |
|
virtual | ~DecisionTree ()=default |
| Make virtual.
|
|
bool | empty () const |
| Check if tree is empty.
|
|
bool | operator== (const DecisionTree &q) const |
| equality
|
|
const Y & | operator() (const Assignment< L > &x) const |
| evaluate
|
|
template<typename Func > |
void | visit (Func f) const |
| Visit all leaves in depth-first fashion.
|
|
template<typename Func > |
void | visitLeaf (Func f) const |
| Visit all leaves in depth-first fashion.
|
|
template<typename Func > |
void | visitWith (Func f) const |
| Visit all leaves in depth-first fashion.
|
|
size_t | nrLeaves () const |
| Return the number of leaves in the tree.
|
|
template<typename Func , typename X > |
X | fold (Func f, X x0) const |
| Fold a binary function over the tree, returning accumulator.
|
|
std::set< L > | labels () const |
| Retrieve all unique labels as a set.
|
|
DecisionTree | apply (const Unary &op) const |
| apply Unary operation "op" to f
|
|
DecisionTree | apply (const UnaryAssignment &op) const |
| Apply Unary operation "op" to f while also providing the corresponding assignment.
|
|
DecisionTree | apply (const DecisionTree &g, const Binary &op) const |
| apply binary operation "op" to f and g
|
|
DecisionTree | choose (const L &label, size_t index) const |
| create a new function where value(label)==index It's like "restrict" in Darwiche09book pg329, 330?
|
|
DecisionTree | combine (const L &label, size_t cardinality, const Binary &op) const |
| combine subtrees on key with binary operation "op"
|
|
DecisionTree | combine (const LabelC &labelC, const Binary &op) const |
| combine with LabelC for convenience
|
|
void | dot (std::ostream &os, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter, bool showZero=true) const |
| output to graphviz format, stream version
|
|
void | dot (const std::string &name, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter, bool showZero=true) const |
| output to graphviz format, open a file
|
|
std::string | dot (const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter, bool showZero=true) const |
| output to graphviz format string
|
|
| DecisionTree (const NodePtr &root) |
|
template<typename Iterator > |
NodePtr | compose (Iterator begin, Iterator end, const L &label) const |
|