parrt / dtreeviz

A python library for decision tree visualization and model interpretation.
MIT License
2.89k stars 332 forks source link

Make leaves and nodes tmp files paths platform independent #296

Closed StepanWorkV closed 1 year ago

StepanWorkV commented 1 year ago

On windows graphviz throws cannot find file exceptions. This is due to the hardcoded unix-style.

Example: C:\Users\username\AppData\Local\Temp/leaf191_25772.svg

parrt commented 1 year ago

@tlapusan looks ok to me. You?

tlapusan commented 1 year ago

Sorry for late response, just got back from vacation...

@parrt it look good for me also. Pulled the PR and double checked that it works also :). Curious how it worked until now on windows ?!

@StepanWorkV thanks for this PR. A very good improved to the library ! Hope that you enjoy using it 👍

StepanWorkV commented 1 year ago

Sorry for late response, just got back from vacation...

@parrt it look good for me also. Pulled the PR and double checked that it works also :). Curious how it worked until now on windows ?!

@StepanWorkV thanks for this PR. A very good improved to the library ! Hope that you enjoy using it 👍

Thanks! It worked because on windows "/" can be in file name, thus when a file was generated it was stored as Temp/leaf191_25772.svg (just my guess, didn't verify that).

BTW please take a look at this issue, I have created that PR while trying to resolve it: https://github.com/parrt/dtreeviz/issues/298 (It didn't solve it though, I have provided some comments why, please let me know if you need some additional clarity)

tlapusan commented 1 year ago

@parrt I think we are good to merge this PR