parrt / dtreeviz

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

Adapt utility function for `sklearn>=1.2.0` #233

Closed windisch closed 1 year ago

windisch commented 1 year ago

This addresses #231 and refactors the setup.py a bit (open for discussion).

The feature extraction from sklearn-pipelines becomes much easier in version 1.2.0. I added a if-condition (similar as suggested by @tlapusan) that checks whether the pipeline allows for this new feature. However, in the long run, maintaining compatibility to all the sklearn versions will increase the code complexity. I recommend to add a lower-bound on the sklearn version at some point.

tlapusan commented 1 year ago

@windisch thanks for taking time and making these changes.

I've tested your changes related to sklearn and they work. Indeed, any version change for any library could break the code, especially for major releases... but we hope we are gonna patch them :)

I'm ok also with the setup.py refactor, do you see any benefit of creating those variable for extra_* ?

windisch commented 1 year ago

@tlapusan: When running the tests, I had to manually install all extras one by one. With these changes, a simple pip install .[all] does.

parrt commented 1 year ago

Thanks for the contribution. Yes I agree this makes sense. Merging