Skip to content

Commit 24db2e2

Browse files
authored
Add compatibility with scikit-learn > 1.5 #major (#142)
1 parent dfe47d1 commit 24db2e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+126
-3721
lines changed

.github/workflows/test-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1919
os: [ubuntu-latest, macOS-latest, windows-latest]
2020
steps:
2121
- uses: actions/checkout@v2

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: "ubuntu-20.04"
55
tools:
6-
python: "3.8"
6+
python: "3.12"
77

88
# Build from the docs/ directory with Sphinx
99
sphinx:

Pipfile

-5
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,9 @@ sphinx_code_tabs = "0.5.3"
2424
sphinx-gallery = "0.10.1"
2525
matplotlib = "3.9.2"
2626
pandas = "1.4.2"
27-
bert-sklearn = {git = "https://github.com/charles9n/bert-sklearn.git@master", editable = true}
2827
black = {version = "24.3.0", extras = ["colorama"]}
2928
pre-commit = "2.20.0"
3029
pyfakefs = "*"
31-
shap = "0.44.1"
32-
xarray = "2023.1.0"
3330

3431
[extras]
3532
ray = "*"
36-
shap = "0.44.1"
37-
xarray = "*"

Pipfile.lock

-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ HiClass is an open-source Python library for hierarchical classification compati
1616
- [Who is using HiClass?](#who-is-using-hiclass)
1717
- [Install](#install)
1818
- [Quick start](#quick-start)
19-
- [Explaining Hierarchical Classifiers](#explaining-hierarchical-classifiers)
2019
- [Step-by-step walk-through](#step-by-step-walk-through)
2120
- [API documentation](#api-documentation)
2221
- [FAQ](#faq)
@@ -34,8 +33,6 @@ HiClass is an open-source Python library for hierarchical classification compati
3433
- **[Build pipelines](https://hiclass.readthedocs.io/en/latest/auto_examples/plot_pipeline.html):** Since the hierarchical classifiers inherit from the BaseEstimator of scikit-learn, pipelines can be built to automate machine learning workflows.
3534
- **[Hierarchical metrics](https://hiclass.readthedocs.io/en/latest/api/utilities.html#hierarchical-metrics):** HiClass supports the computation of hierarchical precision, recall and f-score, which are more appropriate for hierarchical data than traditional metrics.
3635
- **[Compatible with pickle](https://hiclass.readthedocs.io/en/latest/auto_examples/plot_model_persistence.html):** Easily store trained models on disk for future use.
37-
- **[BERT sklearn](https://hiclass.readthedocs.io/en/latest/auto_examples/plot_bert.html):** Compatible with the library [BERT sklearn](https://github.com/charles9n/bert-sklearn).
38-
- **[Hierarchical Explanability](https://hiclass.readthedocs.io/en/latest/algorithms/explainer.html):** HiClass allows explaining hierarchical models using the [SHAP](https://github.com/shap/shap) package.
3936

4037
**Any feature missing on this list?** Search our [issue tracker](https://github.com/scikit-learn-contrib/hiclass/issues) to see if someone has already requested it and add a comment to it explaining your use-case. Otherwise, please open a new issue describing the requested feature and possible use-case scenario. We prioritize our roadmap based on user feedback, so we would love to hear from you.
4138

@@ -115,7 +112,6 @@ pip install hiclass"[<extra_name>]"
115112
Replace <extra_name> with one of the following options:
116113

117114
- ray: Installs the ray package, which is required for parallel processing support.
118-
- xai: Installs the shap and xarray packages, which are required for explaining Hiclass' predictions.
119115

120116
### Option 2: Conda
121117

@@ -201,10 +197,6 @@ pipeline.fit(X_train, Y_train)
201197
predictions = pipeline.predict(X_test)
202198
```
203199

204-
## Explaining Hierarchical Classifiers
205-
206-
Hierarchical classifiers can provide additional insights when combined with explainability methods. HiClass allows explaining hierarchical models using SHAP values. Different hierarchical models yield different insights. More information on explaining [Local classifier per parent node](https://colab.research.google.com/drive/1rVlYuRU_uO1jw5sD6qo2HoCpCz6E6z5J?usp=sharing), [Local classifier per node](https://colab.research.google.com/drive/1wqSl1t_Qn2f62WNZQ48mdB0mNeu1XSF1?usp=sharing), and [Local classifier per level](https://colab.research.google.com/drive/1VnGlJu-1wSG4wxHXL0Ijf2a7Pu3kklT-?usp=sharing) is available on [Read the Docs](https://hiclass.readthedocs.io/en/latest/algorithms/explainer.html).
207-
208200
## Step-by-step walk-through
209201

210202
A step-by-step walk-through is available on our documentation hosted on [Read the Docs](https://hiclass.readthedocs.io/en/latest/index.html).

docs/examples/plot_bert.py

-37
This file was deleted.

docs/examples/plot_lcpl_explainer.py

-59
This file was deleted.

docs/examples/plot_lcpn_explainer.py

-46
This file was deleted.

docs/examples/plot_lcppn_explainer.py

-47
This file was deleted.

docs/examples/plot_multilabel.py

-37
This file was deleted.

docs/requirements.txt

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
# Defining the exact version will make sure things don't break
2-
sphinx==5.0.0
3-
sphinx_rtd_theme==1.0.0
4-
readthedocs-sphinx-search==0.1.2
5-
sphinx_code_tabs==0.5.3
6-
sphinx-gallery==0.10.1
7-
matplotlib==3.5.2
8-
pandas==1.4.2
1+
sphinx
2+
sphinx_rtd_theme
3+
readthedocs-sphinx-search
4+
sphinx_code_tabs
5+
sphinx-gallery
6+
matplotlib
97
ray
108
numpy
11-
git+https://github.com/charles9n/bert-sklearn.git@master
12-
shap==0.44.1
13-
xarray==2023.1.0
-66.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)