Open taltstidl opened 10 months ago
Hi @taltstidl ,
Thanks for raising this issue. There was some work related to it but it wasn't done completely. ex. https://github.com/parrt/dtreeviz/pull/299
I will take a look on it in the next days, it seems to be an issue also when the split nodes don't have samples.
Thanks for the great library. The visualizations are truly great. However, we're running into a crash when some of the leaf nodes do not have any samples in the
X_train
andy_train
data. What seems to happen is the following:render = viz_model.view()
all necessary legend/node/leaf files are created. However, as some of the leaf nodes have no samples, the check in https://github.com/parrt/dtreeviz/blob/a3d02a5fd382bb8e70af92cc9110d9ef73bc86a0/dtreeviz/trees.py#L1261 comes into play and no.svg
file is generated for that leaf.render.save('file.svg')
,dot
tries to render the SVG, but fails as the dot code returned byview
still references the SVG files even though they were not created.Two possible solutions to this:
_class_leaf_viz
).