tabular_trees.TabularTrees

class tabular_trees.TabularTrees(trees, get_root_node_given_tree)[source]

Bases: object

Generic tree structure in tabular format.

__init__(trees, get_root_node_given_tree)[source]

Initialise the TabularTrees object.

Parameters:

trees (pd.DataFrame) – Tree data in tabular structure.

Methods

__init__(trees, get_root_node_given_tree)

Initialise the TabularTrees object.

Attributes

REQUIRED_COLUMNS

List of columns required in tree data.

SORT_BY_COLUMNS

List of columns to sort tree data by.

trees

Tree data.

get_root_node_given_tree

Function that returns the name of the root node for a given tree index.

REQUIRED_COLUMNS = ['tree', 'node', 'left_child', 'right_child', 'missing', 'feature', 'split_condition', 'leaf', 'count', 'prediction']

List of columns required in tree data.

SORT_BY_COLUMNS = ['tree', 'node']

List of columns to sort tree data by.

get_root_node_given_tree

Function that returns the name of the root node for a given tree index.

trees

Tree data.