This creates a separate _tree module for the low-level Tree class.
Here we add some post-fit methods which add detail to the serialized forest grf_forest_. These additional elements are added to enable some properties in Tree, particularly the value property. To calculate this we store leaf sample weights corresponding to leaf_samples, and leaf values of y also corresponding to leaf_samples.
In addition to value we also add the following properties also found in sklearn
node_count
capacity
n_outputs (always 1 for now)
n_classes
We also modify feature and threshold to return -2 for leaf nodes as sklearn does. We also modify the default n_classes_ fit attribute to 1 rather than None in the case of no cluster data.
This creates a separate
_tree
module for the low-levelTree
class.Here we add some post-fit methods which add detail to the serialized forest
grf_forest_
. These additional elements are added to enable some properties inTree
, particularly thevalue
property. To calculate this we store leaf sample weights corresponding toleaf_samples
, and leaf values ofy
also corresponding toleaf_samples
.In addition to
value
we also add the following properties also found in sklearnWe also modify
feature
andthreshold
to return-2
for leaf nodes as sklearn does. We also modify the defaultn_classes_
fit attribute to 1 rather thanNone
in the case of no cluster data.