Skip to content

Commit

Permalink
Add compatibility with scikit-learn > 1.5 #major (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirand863 authored Feb 12, 2025
1 parent dfe47d1 commit 24db2e2
Show file tree
Hide file tree
Showing 43 changed files with 126 additions and 3,721 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: "ubuntu-20.04"
tools:
python: "3.8"
python: "3.12"

# Build from the docs/ directory with Sphinx
sphinx:
Expand Down
5 changes: 0 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ sphinx_code_tabs = "0.5.3"
sphinx-gallery = "0.10.1"
matplotlib = "3.9.2"
pandas = "1.4.2"
bert-sklearn = {git = "https://github.com/charles9n/bert-sklearn.git@master", editable = true}
black = {version = "24.3.0", extras = ["colorama"]}
pre-commit = "2.20.0"
pyfakefs = "*"
shap = "0.44.1"
xarray = "2023.1.0"

[extras]
ray = "*"
shap = "0.44.1"
xarray = "*"
5 changes: 0 additions & 5 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ HiClass is an open-source Python library for hierarchical classification compati
- [Who is using HiClass?](#who-is-using-hiclass)
- [Install](#install)
- [Quick start](#quick-start)
- [Explaining Hierarchical Classifiers](#explaining-hierarchical-classifiers)
- [Step-by-step walk-through](#step-by-step-walk-through)
- [API documentation](#api-documentation)
- [FAQ](#faq)
Expand All @@ -34,8 +33,6 @@ HiClass is an open-source Python library for hierarchical classification compati
- **[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.
- **[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.
- **[Compatible with pickle](https://hiclass.readthedocs.io/en/latest/auto_examples/plot_model_persistence.html):** Easily store trained models on disk for future use.
- **[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).
- **[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.

**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.

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

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

### Option 2: Conda

Expand Down Expand Up @@ -201,10 +197,6 @@ pipeline.fit(X_train, Y_train)
predictions = pipeline.predict(X_test)
```

## Explaining Hierarchical Classifiers

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).

## Step-by-step walk-through

A step-by-step walk-through is available on our documentation hosted on [Read the Docs](https://hiclass.readthedocs.io/en/latest/index.html).
Expand Down
37 changes: 0 additions & 37 deletions docs/examples/plot_bert.py

This file was deleted.

59 changes: 0 additions & 59 deletions docs/examples/plot_lcpl_explainer.py

This file was deleted.

46 changes: 0 additions & 46 deletions docs/examples/plot_lcpn_explainer.py

This file was deleted.

47 changes: 0 additions & 47 deletions docs/examples/plot_lcppn_explainer.py

This file was deleted.

37 changes: 0 additions & 37 deletions docs/examples/plot_multilabel.py

This file was deleted.

17 changes: 6 additions & 11 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# Defining the exact version will make sure things don't break
sphinx==5.0.0
sphinx_rtd_theme==1.0.0
readthedocs-sphinx-search==0.1.2
sphinx_code_tabs==0.5.3
sphinx-gallery==0.10.1
matplotlib==3.5.2
pandas==1.4.2
sphinx
sphinx_rtd_theme
readthedocs-sphinx-search
sphinx_code_tabs
sphinx-gallery
matplotlib
ray
numpy
git+https://github.com/charles9n/bert-sklearn.git@master
shap==0.44.1
xarray==2023.1.0
Binary file removed docs/source/algorithms/explainer-indexing.png
Binary file not shown.
Loading

0 comments on commit 24db2e2

Please sign in to comment.