DTree
DTree(root=None, name=None, **data)A sampleable, serializable decision tree.
Attributes
| Name | Description |
|---|---|
| model_config | dict() -> new empty dictionary |
Methods
| Name | Description |
|---|---|
| expected_value | Return the rolled-back expected value of the tree. |
| plot | Plot sampled tree outcomes as an empirical CDF with a histogram. |
| plot_tree | Plot the decision tree structure from top to bottom. |
| rollback | Return a rollback table indexed by node. |
| rvs | Alias for :meth:sample. |
| sample | Sample outcomes under the rollback-selected policy, without perfect information. |
| summary | Summarize simulated outcomes under the rollback-selected policy. |
expected_value
DTree.expected_value(size=None, seed=None)Return the rolled-back expected value of the tree.
plot
DTree.plot(ax=None, *, size=10000, seed=None, bins=80, show=False, **kwargs)Plot sampled tree outcomes as an empirical CDF with a histogram.
plot_tree
DTree.plot_tree(
ax=None,
*,
size=None,
seed=None,
show_expected_values=True,
show_probabilities=True,
show_selected=True,
precision=2,
show=False,
)Plot the decision tree structure from top to bottom.
rollback
DTree.rollback(size=None, seed=None, precision=2, node_types='decision')Return a rollback table indexed by node.
By default, only decision-node branches are shown. Pass node_types=None to include decision, chance, and outcome nodes, or pass a node type / tuple of node types to filter the table.
rvs
DTree.rvs(size=1, *, seed=None)Alias for :meth:sample.
sample
DTree.sample(size=1, *, seed=None)Sample outcomes under the rollback-selected policy, without perfect information.
summary
DTree.summary(
size=10000,
seed=None,
percentiles=DEFAULT_PERCENTILES,
precision=2,
)Summarize simulated outcomes under the rollback-selected policy.