_regr_leaf_viz() function calculates itself the mean of values for leaf prediction (for regression tree)!
It should use the node.prediction() instead because in some cases we can take the leaf prediction value directly from the tree metadata, which is the correct way to do.
For example, the sklearn by default calculates the median for leaf prediction -> dtreeviz shows the mean, which is not correct.
_regr_leaf_viz() function calculates itself the mean of values for leaf prediction (for regression tree)!
It should use the node.prediction() instead because in some cases we can take the leaf prediction value directly from the tree metadata, which is the correct way to do.
For example, the sklearn by default calculates the median for leaf prediction -> dtreeviz shows the mean, which is not correct.