Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: "ubuntu-22.04"
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
runs-on: "ubuntu-22.04"
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ repos:
- id: blacken-docs
args: [--skip-errors]
additional_dependencies:
- black==22.12.0
- black==26.3.1
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.10"

sphinx:
configuration: docs/source/conf.py
Expand Down
11 changes: 9 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ Subsections for each version can be one of the following;

Each individual change should have a link to the pull request after the description of the change.

1.0.1 (unreleased)
2.0.0 (unreleased)
------------------

Changed
^^^^^^^
- chore: bump minimum python to 310, upgrade black for security fix (need for py310 forced a major version upgrade)

1.1.1 (2024-03-26)
------------------

Changed
Expand All @@ -27,7 +34,7 @@ Changed
- Fixed spelling mistakes and removed stale tubular references (https://github.com/azukds/model_interpreter/pull/8)
- Added example doctests to interpreter.py (https://github.com/azukds/model_interpreter/pull/10)

1.0.0 (2024-08-06)
1.1.0 (2024-11-28)
-------------------

Added
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pytest-benchmark
bandit>=1.7.0
hypothesis==6.53.0
mypy==0.971
black==22.3.0
black>=26.3.1
flake8==5.0.4
pluggy==1.0.0
pre-commit==2.15.0
Expand Down
458 changes: 441 additions & 17 deletions examples/Random_Forest/binary_classification.ipynb

Large diffs are not rendered by default.

460 changes: 442 additions & 18 deletions examples/Random_Forest/multiclass_classification.ipynb

Large diffs are not rendered by default.

48 changes: 34 additions & 14 deletions examples/XGB/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@
"start_time": "2024-04-08T15:42:38.382943Z"
}
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"source": [
"import xgboost as xgb\n",
"\n",
Expand Down Expand Up @@ -224,7 +233,18 @@
"start_time": "2024-04-08T15:42:40.892321Z"
}
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"<shap.explainers._tree.TreeExplainer at 0x7b2f899041f0>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"single_model_contribution.fit(xgb_model)"
]
Expand Down Expand Up @@ -286,7 +306,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[{'Name': 'MedInc', 'Value': -0.7173248529}, {'Name': 'Latitude', 'Value': -0.2954589427}, {'Name': 'AveOccup', 'Value': -0.2584415674}, {'Name': 'Longitude', 'Value': -0.194666937}, {'Name': 'AveRooms', 'Value': 0.0455645546}, {'Name': 'HouseAge', 'Value': -0.0052499785}, {'Name': 'AveBedrms', 'Value': -0.0039967196}, {'Name': 'Population', 'Value': -0.0015882736}]\n"
"[{'Name': 'MedInc', 'Value': -0.7147319912910461}, {'Name': 'AveOccup', 'Value': -0.2794199883937836}, {'Name': 'Latitude', 'Value': -0.2189369648694992}, {'Name': 'Longitude', 'Value': -0.1587740033864975}, {'Name': 'AveRooms', 'Value': 0.0441824235022068}, {'Name': 'Population', 'Value': -0.0064344312995672}, {'Name': 'HouseAge', 'Value': -0.0029389760456979}, {'Name': 'AveBedrms', 'Value': -0.0014929284807295}]\n"
]
}
],
Expand All @@ -311,7 +331,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[{'MedInc': (1.6812, -0.71732485)}, {'Latitude': (36.06, -0.29545894)}, {'AveOccup': (3.8774373259052926, -0.25844157)}, {'Longitude': (-119.01, -0.19466694)}, {'AveRooms': (4.192200557103064, 0.045564555)}, {'HouseAge': (25.0, -0.0052499785)}, {'AveBedrms': (1.0222841225626742, -0.0039967196)}, {'Population': (1392.0, -0.0015882736)}]\n"
"[{'MedInc': (np.float64(1.6812), -0.7147319912910461)}, {'AveOccup': (np.float64(3.8774373259052926), -0.2794199883937836)}, {'Latitude': (np.float64(36.06), -0.2189369648694992)}, {'Longitude': (np.float64(-119.01), -0.1587740033864975)}, {'AveRooms': (np.float64(4.192200557103064), 0.0441824235022068)}, {'Population': (np.float64(1392.0), -0.0064344312995672)}, {'HouseAge': (np.float64(25.0), -0.0029389760456979)}, {'AveBedrms': (np.float64(1.0222841225626742), -0.0014929284807295)}]\n"
]
}
],
Expand Down Expand Up @@ -343,7 +363,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[{'Name': 'MedInc feature', 'Value': -0.7173248529}, {'Name': 'Latitude of location', 'Value': -0.2954589427}, {'Name': 'Average occupation', 'Value': -0.2584415674}, {'Name': 'Longitude of location', 'Value': -0.194666937}, {'Name': 'Average number of rooms', 'Value': 0.0455645546}, {'Name': 'Age of house', 'Value': -0.0052499785}, {'Name': 'Average number of bedrooms', 'Value': -0.0039967196}, {'Name': 'Population feature', 'Value': -0.0015882736}]\n"
"[{'Name': 'MedInc feature', 'Value': -0.7147319912910461}, {'Name': 'Average occupation', 'Value': -0.2794199883937836}, {'Name': 'Latitude of location', 'Value': -0.2189369648694992}, {'Name': 'Longitude of location', 'Value': -0.1587740033864975}, {'Name': 'Average number of rooms', 'Value': 0.0441824235022068}, {'Name': 'Population feature', 'Value': -0.0064344312995672}, {'Name': 'Age of house', 'Value': -0.0029389760456979}, {'Name': 'Average number of bedrooms', 'Value': -0.0014929284807295}]\n"
]
}
],
Expand Down Expand Up @@ -386,7 +406,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[{'Name': 'MedInc feature', 'Value': -0.7173248529}, {'Name': 'Location', 'Value': -0.4901258796}, {'Name': 'Average occupation', 'Value': -0.2584415674}, {'Name': 'Number of rooms', 'Value': 0.0455645546}, {'Name': 'Age of house', 'Value': -0.0052499785}, {'Name': 'Number of bedrooms', 'Value': -0.0039967196}, {'Name': 'Population feature', 'Value': -0.0015882736}]\n"
"[{'Name': 'MedInc feature', 'Value': -0.7147319912910461}, {'Name': 'Location', 'Value': -0.3777109682559967}, {'Name': 'Average occupation', 'Value': -0.2794199883937836}, {'Name': 'Number of rooms', 'Value': 0.0441824235022068}, {'Name': 'Population feature', 'Value': -0.0064344312995672}, {'Name': 'Age of house', 'Value': -0.0029389760456979}, {'Name': 'Number of bedrooms', 'Value': -0.0014929284807295}]\n"
]
}
],
Expand Down Expand Up @@ -436,7 +456,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[{'Name': 'MedInc feature', 'Value': -0.7173248529}, {'Name': 'Latitude of location', 'Value': -0.2954589427}, {'Name': 'Average occupation', 'Value': -0.2584415674}, {'Name': 'Longitude of location', 'Value': -0.194666937}, {'Name': 'Average number of rooms', 'Value': 0.0455645546}]\n"
"[{'Name': 'MedInc feature', 'Value': -0.7147319912910461}, {'Name': 'Average occupation', 'Value': -0.2794199883937836}, {'Name': 'Latitude of location', 'Value': -0.2189369648694992}, {'Name': 'Longitude of location', 'Value': -0.1587740033864975}, {'Name': 'Average number of rooms', 'Value': 0.0441824235022068}]\n"
]
}
],
Expand All @@ -461,7 +481,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[{'Name': 'Average number of rooms', 'Value': 0.0455645546}, {'Name': 'Population feature', 'Value': -0.0015882736}, {'Name': 'Average number of bedrooms', 'Value': -0.0039967196}, {'Name': 'Age of house', 'Value': -0.0052499785}, {'Name': 'Longitude of location', 'Value': -0.194666937}, {'Name': 'Average occupation', 'Value': -0.2584415674}, {'Name': 'Latitude of location', 'Value': -0.2954589427}, {'Name': 'MedInc feature', 'Value': -0.7173248529}]\n"
"[{'Name': 'Average number of rooms', 'Value': 0.0441824235022068}, {'Name': 'Average number of bedrooms', 'Value': -0.0014929284807295}, {'Name': 'Age of house', 'Value': -0.0029389760456979}, {'Name': 'Population feature', 'Value': -0.0064344312995672}, {'Name': 'Longitude of location', 'Value': -0.1587740033864975}, {'Name': 'Latitude of location', 'Value': -0.2189369648694992}, {'Name': 'Average occupation', 'Value': -0.2794199883937836}, {'Name': 'MedInc feature', 'Value': -0.7147319912910461}]\n"
]
}
],
Expand All @@ -486,7 +506,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[{'Name': 'MedInc feature', 'Value': -0.7173248529}, {'Name': 'Latitude of location', 'Value': -0.2954589427}, {'Name': 'Average occupation', 'Value': -0.2584415674}, {'Name': 'Longitude of location', 'Value': -0.194666937}, {'Name': 'Age of house', 'Value': -0.0052499785}, {'Name': 'Average number of bedrooms', 'Value': -0.0039967196}, {'Name': 'Population feature', 'Value': -0.0015882736}, {'Name': 'Average number of rooms', 'Value': 0.0455645546}]\n"
"[{'Name': 'MedInc feature', 'Value': -0.7147319912910461}, {'Name': 'Average occupation', 'Value': -0.2794199883937836}, {'Name': 'Latitude of location', 'Value': -0.2189369648694992}, {'Name': 'Longitude of location', 'Value': -0.1587740033864975}, {'Name': 'Population feature', 'Value': -0.0064344312995672}, {'Name': 'Age of house', 'Value': -0.0029389760456979}, {'Name': 'Average number of bedrooms', 'Value': -0.0014929284807295}, {'Name': 'Average number of rooms', 'Value': 0.0441824235022068}]\n"
]
}
],
Expand Down Expand Up @@ -518,7 +538,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{'MedInc feature': -0.71732485, 'Latitude of location': -0.29545894, 'Average occupation': -0.25844157, 'Longitude of location': -0.19466694, 'Average number of rooms': 0.045564555}\n"
"{'MedInc feature': -0.7147319912910461, 'Average occupation': -0.2794199883937836, 'Latitude of location': -0.2189369648694992, 'Longitude of location': -0.1587740033864975, 'Average number of rooms': 0.0441824235022068}\n"
]
}
],
Expand All @@ -543,7 +563,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[('MedInc feature', -0.71732485), ('Latitude of location', -0.29545894), ('Average occupation', -0.25844157), ('Longitude of location', -0.19466694), ('Average number of rooms', 0.045564555)]\n"
"[('MedInc feature', -0.7147319912910461), ('Average occupation', -0.2794199883937836), ('Latitude of location', -0.2189369648694992), ('Longitude of location', -0.1587740033864975), ('Average number of rooms', 0.0441824235022068)]\n"
]
}
],
Expand All @@ -557,9 +577,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "model_interpreter",
"display_name": "Python 3",
"language": "python",
"name": "model_interpreter"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -571,7 +591,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.10.12"
},
"toc": {
"base_numbering": 1,
Expand Down
Loading
Loading