col_gen_estimator.Path

class col_gen_estimator.Path[source]

All path related information.

Attributes:
leaf_id: (int) ID of the associated leaf.
node_ids: (list(int)) IDs of the nodes in the path.
splits: (list(int)) IDs of the selected splits for nodes in the path.

The order of splits must match the order of nodes.

cost: (int) Number of rows following the path with correct target.
id: (int) ID of the path.
target: (int) Associated target of the path.
__init__() None[source]
is_same_as(path)[source]

Returns true if the current path is same as the path in the argument.

Parameters:
path: (Path) The other path being compared to.
print_path()[source]

Prints the attributes of the path.

set_leaf(leaf_id, depth)[source]

For a full binary tree, populates the nodes corresponding to the given leaf_id.

Parameters:
leaf_id: (int) The ID of the leaf.
depth: (int) Depth of the path.

Examples using col_gen_estimator.Path

sphx_glr_auto_examples_dtree_experiment.py

Code to launch decision tree experiments.