Skip to content

Commit

Permalink
Merge pull request #14 from knowlab/harry/adult_tutorial
Browse files Browse the repository at this point in the history
Harry/adult tutorial
  • Loading branch information
HarrisonWilde committed Sep 18, 2024
2 parents a8a80d1 + d929b5b commit abe7a94
Show file tree
Hide file tree
Showing 8 changed files with 672 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ jobs:
name: release-dists
path: dist/
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.6.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
}
1 change: 0 additions & 1 deletion daindex/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def kde_estimate(

kde = KernelDensity(bandwidth=bandwidth, kernel=kernel)
kde.fit(X)

return kde, bandwidth


Expand Down
8 changes: 7 additions & 1 deletion daindex/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def viz(
g2_label: str,
deterioration_label: str,
allocation_label: str,
config: dict,
config: dict = {},
decision_boundary: float = 0.5,
) -> None:
"""
Expand Down Expand Up @@ -181,3 +181,9 @@ def viz(
plt.axvspan(decision_boundary, 1, facecolor="b", alpha=0.1)

plt.legend(fontsize=font_size, loc="best")

return_dict = {"AUC": (a2 - a1) / a1}
if da1:
return_dict.update({"Decision AUC": (da2 - da1) / da1})

return return_dict
53 changes: 44 additions & 9 deletions poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ optional = true
[tool.poetry.group.tutorials.dependencies]
jupyter = "^1.1.1"
notebook = "^7.2.2"
aif360 = "^0.6.1"

[tool.ruff]
include = ["*.py", "*.pyi", "pyproject.toml", "*.ipynb"]
Expand Down
Loading

0 comments on commit abe7a94

Please sign in to comment.