testDecisionTreeFactor.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
12 /*
13  * testDecisionTreeFactor.cpp
14  *
15  * @date Feb 5, 2012
16  * @author Frank Dellaert
17  * @author Duy-Nguyen Ta
18  */
19 
21 #include <gtsam/base/Testable.h>
28 #include <gtsam/inference/Key.h>
30 
31 using namespace std;
32 using namespace gtsam;
33 
35 DecisionTreeFactor create(const Signature& signature) {
36  DecisionTreeFactor p(signature.discreteKeys(), signature.cpt());
37  return p;
38 }
39 
40 /* ************************************************************************* */
41 TEST(DecisionTreeFactor, ConstructorsMatch) {
42  // Declare two keys
43  DiscreteKey X(0, 2), Y(1, 3);
44 
45  // Create with vector and with string
46  const std::vector<double> table{2, 5, 3, 6, 4, 7};
48  DecisionTreeFactor f2({X, Y}, "2 5 3 6 4 7");
50 }
51 
52 /* ************************************************************************* */
53 TEST(DecisionTreeFactor, constructors) {
54  // Declare a bunch of keys
55  DiscreteKey X(0, 2), Y(1, 3), Z(2, 2);
56 
57  // Create factors
58  DecisionTreeFactor f1(X, {2, 8});
59  DecisionTreeFactor f2(X & Y, "2 5 3 6 4 7");
60  DecisionTreeFactor f3(X & Y & Z, "2 5 3 6 4 7 25 55 35 65 45 75");
61  EXPECT_LONGS_EQUAL(1, f1.size());
62  EXPECT_LONGS_EQUAL(2, f2.size());
63  EXPECT_LONGS_EQUAL(3, f3.size());
64 
65  DiscreteValues x121{{0, 1}, {1, 2}, {2, 1}};
66  EXPECT_DOUBLES_EQUAL(8, f1(x121), 1e-9);
67  EXPECT_DOUBLES_EQUAL(7, f2(x121), 1e-9);
68  EXPECT_DOUBLES_EQUAL(75, f3(x121), 1e-9);
69 
70  // Assert that error = -log(value)
71  EXPECT_DOUBLES_EQUAL(-log(f1(x121)), f1.error(x121), 1e-9);
72 
73  // Construct from DiscreteConditional
74  DiscreteConditional conditional(X | Y = "1/1 2/3 1/4");
75  DecisionTreeFactor f4(conditional);
76  EXPECT_DOUBLES_EQUAL(0.8, f4(x121), 1e-9);
77 }
78 
79 /* ************************************************************************* */
81  // Declare a bunch of keys
82  DiscreteKey X(0, 2), Y(1, 3), Z(2, 2);
83 
84  // Create factors
85  DecisionTreeFactor f(X & Y & Z, "2 5 3 6 4 7 25 55 35 65 45 75");
86 
87  auto errors = f.errorTree();
88  // regression
90  {X, Y, Z},
91  vector<double>{-0.69314718, -1.6094379, -1.0986123, -1.7917595,
92  -1.3862944, -1.9459101, -3.2188758, -4.0073332, -3.5553481,
93  -4.1743873, -3.8066625, -4.3174881});
94  EXPECT(assert_equal(expected, errors, 1e-6));
95 }
96 
97 /* ************************************************************************* */
98 TEST(DecisionTreeFactor, multiplication) {
99  DiscreteKey v0(0, 2), v1(1, 2), v2(2, 2);
100 
101  // Multiply with a DiscreteDistribution, i.e., Bayes Law!
102  DiscreteDistribution prior(v1 % "1/3");
103  DecisionTreeFactor f1(v0 & v1, "1 2 3 4");
104  DecisionTreeFactor expected(v0 & v1, "0.25 1.5 0.75 3");
107 
108  // Multiply two factors
109  DecisionTreeFactor f2(v1 & v2, "5 6 7 8");
110  DecisionTreeFactor actual = f1 * f2;
111  DecisionTreeFactor expected2(v0 & v1 & v2, "5 6 14 16 15 18 28 32");
112  CHECK(assert_equal(expected2, actual));
113 }
114 
115 /* ************************************************************************* */
117  DiscreteKey A(0, 2), S(1, 2);
118  DecisionTreeFactor pA = create(A % "99/1"), pS = create(S % "50/50");
119  DecisionTreeFactor joint = pA * pS;
120 
121  DecisionTreeFactor s = joint / pA;
122 
123  // Factors are not equal due to difference in keys
125 
126  // The underlying data should be the same
127 #ifdef GTSAM_DT_MERGING
129  EXPECT(assert_equal(ADT(pS), ADT(s)));
130 #endif
131 
132  KeySet keys(joint.keys());
133  keys.insert(pA.keys().begin(), pA.keys().end());
134  EXPECT(assert_inequal(KeySet(pS.keys()), keys));
135 }
136 
137 /* ************************************************************************* */
139  DiscreteKey v0(0, 3), v1(1, 2);
140  DecisionTreeFactor f1(v0 & v1, "1 2 3 4 5 6");
141 
142  DecisionTreeFactor expected(v1, "9 12");
143  auto actual = std::dynamic_pointer_cast<DecisionTreeFactor>(f1.sum(1));
144  CHECK(actual);
145  CHECK(assert_equal(expected, *actual, 1e-5));
146 
147  DecisionTreeFactor expected2(v1, "5 6");
148  auto actual2 = std::dynamic_pointer_cast<DecisionTreeFactor>(f1.max(1));
149  CHECK(actual2);
150  CHECK(assert_equal(expected2, *actual2));
151 
152  DecisionTreeFactor f2(v1 & v0, "1 2 3 4 5 6");
153  auto actual22 = std::dynamic_pointer_cast<DecisionTreeFactor>(f2.sum(1));
154  CHECK(actual22);
155 }
156 
157 /* ************************************************************************* */
158 // Check enumerate yields the correct list of assignment/value pairs.
160  DiscreteKey A(12, 3), B(5, 2);
161  DecisionTreeFactor f(A & B, "1 2 3 4 5 6");
162  auto actual = f.enumerate();
163  std::vector<std::pair<DiscreteValues, double>> expected;
165  for (size_t a : {0, 1, 2}) {
166  for (size_t b : {0, 1}) {
167  values[12] = a;
168  values[5] = b;
169  expected.emplace_back(values, f(values));
170  }
171  }
172  EXPECT(actual == expected);
173 }
174 
175 namespace pruning_fixture {
176 
177 DiscreteKey A(1, 2), B(2, 2), C(3, 2);
178 DecisionTreeFactor f(A& B& C, "1 5 3 7 2 6 4 8");
179 
180 DiscreteKey D(4, 2);
182  D& C & B & A,
183  "0.0 0.0 0.0 0.60658897 0.61241912 0.61241969 0.61247685 0.61247742 0.0 "
184  "0.0 0.0 0.99995287 1.0 1.0 1.0 1.0");
185 
186 } // namespace pruning_fixture
187 
188 /* ************************************************************************* */
189 // Check if computing the correct threshold works.
190 TEST(DecisionTreeFactor, ComputeThreshold) {
191  using namespace pruning_fixture;
192 
193  // Only keep the leaves with the top 5 values.
194  double threshold = f.computeThreshold(5);
195  EXPECT_DOUBLES_EQUAL(4.0, threshold, 1e-9);
196 
197  // Check for more extreme pruning where we only keep the top 2 leaves
198  threshold = f.computeThreshold(2);
199  EXPECT_DOUBLES_EQUAL(7.0, threshold, 1e-9);
200 
201  threshold = factor.computeThreshold(5);
202  EXPECT_DOUBLES_EQUAL(0.99995287, threshold, 1e-9);
203 
204  threshold = factor.computeThreshold(3);
205  EXPECT_DOUBLES_EQUAL(1.0, threshold, 1e-9);
206 
207  threshold = factor.computeThreshold(6);
208  EXPECT_DOUBLES_EQUAL(0.61247742, threshold, 1e-9);
209 }
210 
211 /* ************************************************************************* */
212 // Check pruning of the decision tree works as expected.
214  using namespace pruning_fixture;
215 
216  // Only keep the leaves with the top 5 values.
217  size_t maxNrAssignments = 5;
218  auto pruned5 = f.prune(maxNrAssignments);
219 
220  // Pruned leaves should be 0
221  DecisionTreeFactor expected(A & B & C, "0 5 0 7 0 6 4 8");
222  EXPECT(assert_equal(expected, pruned5));
223 
224  // Check for more extreme pruning where we only keep the top 2 leaves
225  maxNrAssignments = 2;
226  auto pruned2 = f.prune(maxNrAssignments);
227  DecisionTreeFactor expected2(A & B & C, "0 0 0 7 0 0 0 8");
228  EXPECT(assert_equal(expected2, pruned2));
229 
230  DecisionTreeFactor expected3(D & C & B & A,
231  "0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 "
232  "0.999952870000 1.0 1.0 1.0 1.0");
233  maxNrAssignments = 5;
234  auto pruned3 = factor.prune(maxNrAssignments);
235  EXPECT(assert_equal(expected3, pruned3));
236 
237  // Edge case where the number of hypotheses are less than maxNrAssignments
238  DecisionTreeFactor f(A, "0.50001 0.49999");
239  auto pruned4 = f.prune(10);
240  DecisionTreeFactor expected4(A, "0.50001 0.49999");
241  EXPECT(assert_equal(expected4, pruned4));
242 }
243 
244 /* ************************************************************************** */
245 // Asia Bayes Network
246 /* ************************************************************************** */
247 
248 #define DISABLE_DOT
249 
250 void maybeSaveDotFile(const DecisionTreeFactor& f, const string& filename) {
251 #ifndef DISABLE_DOT
252  std::vector<std::string> names = {"A", "S", "T", "L", "B", "E", "X", "D"};
253  auto formatter = [&](Key key) { return names[key]; };
254  f.dot(filename, formatter, true);
255 #endif
256 }
257 
258 /* ************************************************************************* */
259 // test Asia Joint
261  DiscreteKey A(0, 2), S(1, 2), T(2, 2), L(3, 2), B(4, 2), E(5, 2), X(6, 2),
262  D(7, 2);
263 
264  gttic_(asiaCPTs);
265  DecisionTreeFactor pA = create(A % "99/1");
266  DecisionTreeFactor pS = create(S % "50/50");
267  DecisionTreeFactor pT = create(T | A = "99/1 95/5");
268  DecisionTreeFactor pL = create(L | S = "99/1 90/10");
269  DecisionTreeFactor pB = create(B | S = "70/30 40/60");
270  DecisionTreeFactor pE = create((E | T, L) = "F T T T");
271  DecisionTreeFactor pX = create(X | E = "95/5 2/98");
272  DecisionTreeFactor pD = create((D | E, B) = "9/1 2/8 3/7 1/9");
273 
274  // Create joint
275  gttic_(asiaJoint);
276  DecisionTreeFactor joint = pA;
277  maybeSaveDotFile(joint, "Asia-A");
278  joint = joint * pS;
279  maybeSaveDotFile(joint, "Asia-AS");
280  joint = joint * pT;
281  maybeSaveDotFile(joint, "Asia-AST");
282  joint = joint * pL;
283  maybeSaveDotFile(joint, "Asia-ASTL");
284  joint = joint * pB;
285  maybeSaveDotFile(joint, "Asia-ASTLB");
286  joint = joint * pE;
287  maybeSaveDotFile(joint, "Asia-ASTLBE");
288  joint = joint * pX;
289  maybeSaveDotFile(joint, "Asia-ASTLBEX");
290  joint = joint * pD;
291  maybeSaveDotFile(joint, "Asia-ASTLBEXD");
292 
293  // Check that discrete keys are as expected
294  EXPECT(assert_equal(joint.discreteKeys(), {A, S, T, L, B, E, X, D}));
295 
296  // Check that summing out variables maintains the keys even if merged, as is
297  // the case with S.
298  auto noAB = joint.sum(Ordering{A.first, B.first});
299  EXPECT(assert_equal(noAB->discreteKeys(), {S, T, L, E, X, D}));
300 }
301 
302 /* ************************************************************************* */
303 TEST(DecisionTreeFactor, DotWithNames) {
304  DiscreteKey A(12, 3), B(5, 2);
305  DecisionTreeFactor f(A & B, "1 2 3 4 5 6");
306  auto formatter = [](Key key) { return key == 12 ? "A" : "B"; };
307 
308  for (bool showZero : {true, false}) {
309  string actual = f.dot(formatter, showZero);
310  // pretty weak test, as ids are pointers and not stable across platforms.
311  string expected = "digraph G {";
312  EXPECT(actual.substr(0, 11) == expected);
313  }
314 }
315 
316 /* ************************************************************************* */
317 // Check markdown representation looks as expected.
319  DiscreteKey A(12, 3), B(5, 2);
320  DecisionTreeFactor f(A & B, "1 2 3 4 5 6");
321  string expected =
322  "|A|B|value|\n"
323  "|:-:|:-:|:-:|\n"
324  "|0|0|1|\n"
325  "|0|1|2|\n"
326  "|1|0|3|\n"
327  "|1|1|4|\n"
328  "|2|0|5|\n"
329  "|2|1|6|\n";
330  auto formatter = [](Key key) { return key == 12 ? "A" : "B"; };
331  string actual = f.markdown(formatter);
332  EXPECT(actual == expected);
333 }
334 
335 /* ************************************************************************* */
336 // Check markdown representation with a value formatter.
337 TEST(DecisionTreeFactor, markdownWithValueFormatter) {
338  DiscreteKey A(12, 3), B(5, 2);
339  DecisionTreeFactor f(A & B, "1 2 3 4 5 6");
340  string expected =
341  "|A|B|value|\n"
342  "|:-:|:-:|:-:|\n"
343  "|Zero|-|1|\n"
344  "|Zero|+|2|\n"
345  "|One|-|3|\n"
346  "|One|+|4|\n"
347  "|Two|-|5|\n"
348  "|Two|+|6|\n";
349  auto keyFormatter = [](Key key) { return key == 12 ? "A" : "B"; };
350  DecisionTreeFactor::Names names{{12, {"Zero", "One", "Two"}},
351  {5, {"-", "+"}}};
352  string actual = f.markdown(keyFormatter, names);
353  EXPECT(actual == expected);
354 }
355 
356 /* ************************************************************************* */
357 // Check html representation with a value formatter.
358 TEST(DecisionTreeFactor, htmlWithValueFormatter) {
359  DiscreteKey A(12, 3), B(5, 2);
360  DecisionTreeFactor f(A & B, "1 2 3 4 5 6");
361  string expected =
362  "<div>\n"
363  "<table class='DecisionTreeFactor'>\n"
364  " <thead>\n"
365  " <tr><th>A</th><th>B</th><th>value</th></tr>\n"
366  " </thead>\n"
367  " <tbody>\n"
368  " <tr><th>Zero</th><th>-</th><td>1</td></tr>\n"
369  " <tr><th>Zero</th><th>+</th><td>2</td></tr>\n"
370  " <tr><th>One</th><th>-</th><td>3</td></tr>\n"
371  " <tr><th>One</th><th>+</th><td>4</td></tr>\n"
372  " <tr><th>Two</th><th>-</th><td>5</td></tr>\n"
373  " <tr><th>Two</th><th>+</th><td>6</td></tr>\n"
374  " </tbody>\n"
375  "</table>\n"
376  "</div>";
377  auto keyFormatter = [](Key key) { return key == 12 ? "A" : "B"; };
378  DecisionTreeFactor::Names names{{12, {"Zero", "One", "Two"}},
379  {5, {"-", "+"}}};
380  string actual = f.html(keyFormatter, names);
381  EXPECT(actual == expected);
382 }
383 
384 /* ************************************************************************* */
385 int main() {
386  TestResult tr;
387  return TestRegistry::runAllTests(tr);
388 }
389 /* ************************************************************************* */
gtsam::Signature::cpt
std::vector< double > cpt() const
Definition: Signature.cpp:69
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition: TestRegistry.cpp:27
gtsam::DiscreteFactor::errorTree
virtual AlgebraicDecisionTree< Key > errorTree() const
Compute error for each assignment and return as a tree.
Definition: DiscreteFactor.cpp:59
gtsam::markdown
string markdown(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of markdown.
Definition: DiscreteValues.cpp:153
gtsam::DecisionTreeFactor
Definition: DecisionTreeFactor.h:45
B
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
Definition: bench_gemm.cpp:49
test_constructor::f1
auto f1
Definition: testHybridNonlinearFactor.cpp:56
gtsam::DecisionTreeFactor::computeThreshold
double computeThreshold(const size_t N) const
Compute the probability value which is the threshold above which only N leaves are present.
Definition: DecisionTreeFactor.cpp:454
s
RealScalar s
Definition: level1_cplx_impl.h:126
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
v0
static const double v0
Definition: testCal3DFisheye.cpp:31
EXPECT_LONGS_EQUAL
#define EXPECT_LONGS_EQUAL(expected, actual)
Definition: Test.h:154
Testable.h
Concept check for values that can be used in unit tests.
EXPECT
#define EXPECT(condition)
Definition: Test.h:150
TestHarness.h
gtsam::DecisionTreeFactor::dot
void dot(std::ostream &os, const KeyFormatter &keyFormatter=DefaultKeyFormatter, bool showZero=true) const
Definition: DecisionTreeFactor.cpp:299
keys
const KeyVector keys
Definition: testRegularImplicitSchurFactor.cpp:40
b
Scalar * b
Definition: benchVecAdd.cpp:17
asiaCPTs::pX
ADT pX
Definition: testAlgebraicDecisionTree.cpp:168
gtsam::DiscreteDistribution
Definition: DiscreteDistribution.h:33
gtsam::Y
GaussianFactorGraphValuePair Y
Definition: HybridGaussianProductFactor.cpp:29
pruning_fixture::f
DecisionTreeFactor f(A &B &C, "1 5 3 7 2 6 4 8")
asiaCPTs::pA
ADT pA
Definition: testAlgebraicDecisionTree.cpp:162
pruning_fixture::C
DiscreteKey C(3, 2)
gtsam::DecisionTreeFactor::prune
DecisionTreeFactor prune(size_t maxNrAssignments) const
Prune the decision tree of discrete variables.
Definition: DecisionTreeFactor.cpp:512
asiaCPTs
Definition: testAlgebraicDecisionTree.cpp:158
maybeSaveDotFile
void maybeSaveDotFile(const DecisionTreeFactor &f, const string &filename)
Definition: testDecisionTreeFactor.cpp:250
formatter
const KeyFormatter & formatter
Definition: treeTraversal-inst.h:204
f2
double f2(const Vector2 &x)
Definition: testNumericalDerivative.cpp:58
pruning_fixture::D
DiscreteKey D(4, 2)
T
Eigen::Triplet< double > T
Definition: Tutorial_sparse_example.cpp:6
different_sigmas::values
HybridValues values
Definition: testHybridBayesNet.cpp:247
log
const EIGEN_DEVICE_FUNC LogReturnType log() const
Definition: ArrayCwiseUnaryOps.h:128
Ordering.h
Variable ordering for the elimination algorithm.
X
#define X
Definition: icosphere.cpp:20
TEST
TEST(DecisionTreeFactor, ConstructorsMatch)
Definition: testDecisionTreeFactor.cpp:41
gtsam::FastSet< Key >
create
DecisionTreeFactor create(const Signature &signature)
Definition: testDecisionTreeFactor.cpp:35
TestableAssertions.h
Provides additional testing facilities for common data structures.
A
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:48
gtsam::AlgebraicDecisionTree< Key >
pruning_fixture::factor
DecisionTreeFactor factor(D &C &B &A, "0.0 0.0 0.0 0.60658897 0.61241912 0.61241969 0.61247685 0.61247742 0.0 " "0.0 0.0 0.99995287 1.0 1.0 1.0 1.0")
Key.h
asiaCPTs::pE
ADT pE
Definition: testAlgebraicDecisionTree.cpp:167
gtsam::KeySet
FastSet< Key > KeySet
Definition: Key.h:96
ADT
AlgebraicDecisionTree< Key > ADT
Definition: testAlgebraicDecisionTree.cpp:32
table
ArrayXXf table(10, 4)
main
int main()
Definition: testDecisionTreeFactor.cpp:385
gttic_
#define gttic_(label)
Definition: timing.h:268
relicense.filename
filename
Definition: relicense.py:57
DiscreteFactor.h
Signature.h
signatures for conditional densities
cholesky::expected
Matrix expected
Definition: testMatrix.cpp:916
L
MatrixXd L
Definition: LLT_example.cpp:6
asiaCPTs::pT
ADT pT
Definition: testAlgebraicDecisionTree.cpp:164
asiaCPTs::pS
ADT pS
Definition: testAlgebraicDecisionTree.cpp:163
Eigen::Triplet< double >
EXPECT_DOUBLES_EQUAL
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
Definition: Test.h:161
asiaCPTs::pD
ADT pD
Definition: testAlgebraicDecisionTree.cpp:169
serializationTestHelpers.h
TestResult
Definition: TestResult.h:26
key
const gtsam::Symbol key('X', 0)
E
DiscreteKey E(5, 2)
process_shonan_timing_results.names
dictionary names
Definition: process_shonan_timing_results.py:175
gtsam::DiscreteConditional
Definition: DiscreteConditional.h:37
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
gtsam
traits
Definition: SFMdata.h:40
gtsam::DiscreteValues
Definition: DiscreteValues.h:34
f3
double f3(double x1, double x2)
Definition: testNumericalDerivative.cpp:78
DiscreteDistribution.h
gtsam::Factor::keys
const KeyVector & keys() const
Access the factor's involved variable keys.
Definition: Factor.h:143
CHECK
#define CHECK(condition)
Definition: Test.h:108
gtsam::DiscreteKey
std::pair< Key, size_t > DiscreteKey
Definition: DiscreteKey.h:38
std
Definition: BFloat16.h:88
p
float * p
Definition: Tutorial_Map_using.cpp:9
v2
Vector v2
Definition: testSerializationBase.cpp:39
gtsam::DecisionTreeFactor::html
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override
Render as html table.
Definition: DecisionTreeFactor.cpp:351
gtsam::DecisionTreeFactor::sum
DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override
Create new factor by summing all values with the same separator values.
Definition: DecisionTreeFactor.h:201
pruning_fixture
Definition: testDecisionTreeFactor.cpp:175
f4
double f4(double x, double y, double z)
Definition: testNumericalDerivative.cpp:107
gtsam::assert_equal
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:41
gtsam::DecisionTreeFactor::enumerate
std::vector< std::pair< DiscreteValues, double > > enumerate() const
Enumerate all values into a map from values to double.
Definition: DecisionTreeFactor.cpp:231
gtsam::Signature::discreteKeys
DiscreteKeys discreteKeys() const
Definition: Signature.cpp:55
gtsam::assert_inequal
bool assert_inequal(const Matrix &A, const Matrix &B, double tol)
Definition: Matrix.cpp:61
different_sigmas::prior
const auto prior
Definition: testHybridBayesNet.cpp:240
gtsam::DiscreteFactor::discreteKeys
DiscreteKeys discreteKeys() const
Return all the discrete keys associated with this factor.
Definition: DiscreteFactor.cpp:37
asiaCPTs::pB
ADT pB
Definition: testAlgebraicDecisionTree.cpp:166
gtsam::Key
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:97
Z
#define Z
Definition: icosphere.cpp:21
gtsam::Ordering
Definition: inference/Ordering.h:33
asiaCPTs::pL
ADT pL
Definition: testAlgebraicDecisionTree.cpp:165
DecisionTreeFactor.h
gtsam::DecisionTreeFactor::markdown
std::string markdown(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const Names &names={}) const override
Render as markdown table.
Definition: DecisionTreeFactor.cpp:320
gtsam::Signature
Definition: Signature.h:54
S
DiscreteKey S(1, 2)
v1
Vector v1
Definition: testSerializationBase.cpp:38


gtsam
Author(s):
autogenerated on Wed Mar 19 2025 03:06:32