badr 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. badr-0.1.0/.github/workflows/release.yml +53 -0
  2. badr-0.1.0/.gitignore +32 -0
  3. badr-0.1.0/.readthedocs.yaml +20 -0
  4. badr-0.1.0/LICENSE +674 -0
  5. badr-0.1.0/PKG-INFO +56 -0
  6. badr-0.1.0/README.md +24 -0
  7. badr-0.1.0/badr/__base__.py +126 -0
  8. badr-0.1.0/badr/__init__.py +13 -0
  9. badr-0.1.0/badr/_version.py +1 -0
  10. badr-0.1.0/badr/algorithms/__base__.py +90 -0
  11. badr-0.1.0/badr/algorithms/__init__.py +13 -0
  12. badr-0.1.0/badr/algorithms/badr.py +247 -0
  13. badr-0.1.0/badr/algorithms/frank_wolfe.py +137 -0
  14. badr-0.1.0/badr/algorithms/slsqp.py +130 -0
  15. badr-0.1.0/badr/algorithms/trust_constr.py +111 -0
  16. badr-0.1.0/badr/datasets/__init__.py +207 -0
  17. badr-0.1.0/badr/datasets/adult.py +200 -0
  18. badr-0.1.0/badr/datasets/arrhythmia.py +404 -0
  19. badr-0.1.0/badr/datasets/communities_and_crime.py +143 -0
  20. badr-0.1.0/badr/datasets/compas.py +178 -0
  21. badr-0.1.0/badr/datasets/dataframe.py +168 -0
  22. badr-0.1.0/badr/datasets/folktables.py +881 -0
  23. badr-0.1.0/badr/datasets/german_credit.py +255 -0
  24. badr-0.1.0/badr/datasets/law_school.py +150 -0
  25. badr-0.1.0/badr/datasets/parkinsons_telemonitoring.py +117 -0
  26. badr-0.1.0/badr/datasets/student_performance.py +159 -0
  27. badr-0.1.0/badr/metrics/__base__.py +90 -0
  28. badr-0.1.0/badr/metrics/__init__.py +19 -0
  29. badr-0.1.0/badr/metrics/demographic_parity.py +53 -0
  30. badr-0.1.0/badr/metrics/disparate_mistreatment.py +35 -0
  31. badr-0.1.0/badr/metrics/equal_opportunity.py +43 -0
  32. badr-0.1.0/badr/metrics/equalized_odds.py +55 -0
  33. badr-0.1.0/badr/metrics/group_variance.py +61 -0
  34. badr-0.1.0/badr/metrics/hsic.py +38 -0
  35. badr-0.1.0/badr/metrics/individual_fairness.py +58 -0
  36. badr-0.1.0/badr/models/__base__.py +106 -0
  37. badr-0.1.0/badr/models/__init__.py +14 -0
  38. badr-0.1.0/badr/models/_logistic_regression.py +267 -0
  39. badr-0.1.0/badr/models/_ridge_regression.py +363 -0
  40. badr-0.1.0/badr/models/_smooth_svm.py +467 -0
  41. badr-0.1.0/badr/oracles/__base__.py +101 -0
  42. badr-0.1.0/badr/oracles/__init__.py +5 -0
  43. badr-0.1.0/badr/oracles/implicit_oracle.py +125 -0
  44. badr-0.1.0/badr/oracles/stochastic_oracle.py +385 -0
  45. badr-0.1.0/docs/getting-started/index.md +93 -0
  46. badr-0.1.0/docs/images/favicon.png +0 -0
  47. badr-0.1.0/docs/index.md +63 -0
  48. badr-0.1.0/docs/javascripts/katex.js +10 -0
  49. badr-0.1.0/docs/reference/algorithms.md +16 -0
  50. badr-0.1.0/docs/reference/badr.md +16 -0
  51. badr-0.1.0/docs/reference/datasets.md +16 -0
  52. badr-0.1.0/docs/reference/index.md +23 -0
  53. badr-0.1.0/docs/reference/metrics.md +26 -0
  54. badr-0.1.0/docs/reference/models.md +22 -0
  55. badr-0.1.0/docs/reference/oracles.md +16 -0
  56. badr-0.1.0/docs/requirements.txt +5 -0
  57. badr-0.1.0/docs/styles/pygments-dark.css +439 -0
  58. badr-0.1.0/docs/styles/pygments-light.css +347 -0
  59. badr-0.1.0/experiments/experiment_1/experiment_1.ipynb +883 -0
  60. badr-0.1.0/experiments/experiment_2/logs.jsonl +2102 -0
  61. badr-0.1.0/experiments/experiment_2/notebook.ipynb +56 -0
  62. badr-0.1.0/experiments/experiment_2/plotter.py +213 -0
  63. badr-0.1.0/experiments/experiment_2/results.jsonl +4500 -0
  64. badr-0.1.0/experiments/experiment_2/results_completed_keys.json +6305 -0
  65. badr-0.1.0/experiments/experiment_2/script.py +519 -0
  66. badr-0.1.0/experiments/experiment_3/notebook.ipynb +381 -0
  67. badr-0.1.0/experiments/experiment_3/outputs/classification_records.jsonl +375 -0
  68. badr-0.1.0/experiments/experiment_3/outputs/classification_summary.json +30 -0
  69. badr-0.1.0/experiments/experiment_3/outputs/regression_records.jsonl +200 -0
  70. badr-0.1.0/experiments/experiment_3/outputs/regression_summary.json +30 -0
  71. badr-0.1.0/experiments/experiment_3/script.py +446 -0
  72. badr-0.1.0/experiments/figure_2/data_dict.json +1865 -0
  73. badr-0.1.0/experiments/figure_2/results.json +752 -0
  74. badr-0.1.0/experiments/figure_2/script.py +935 -0
  75. badr-0.1.0/experiments/scalability/badr_results.json +120659 -0
  76. badr-0.1.0/experiments/scalability/badr_scalability.py +246 -0
  77. badr-0.1.0/experiments/scalability/group_scalability.pkl +0 -0
  78. badr-0.1.0/experiments/scalability/notebook.ipynb +373 -0
  79. badr-0.1.0/figures/badr_scales.pdf +0 -0
  80. badr-0.1.0/figures/experiment_1_2gr.pdf +0 -0
  81. badr-0.1.0/figures/experiment_1_3gr.pdf +0 -0
  82. badr-0.1.0/figures/experiment_2.pdf +0 -0
  83. badr-0.1.0/figures/figure_2.pdf +0 -0
  84. badr-0.1.0/figures/scalability_per_group.pdf +0 -0
  85. badr-0.1.0/mkdocs.yml +130 -0
  86. badr-0.1.0/pyproject.toml +61 -0
  87. badr-0.1.0/uv.lock +1320 -0
@@ -0,0 +1,53 @@
1
+ name: Publish to PyPI
2
+
3
+ # Publishes to PyPI when a GitHub Release is published.
4
+ # Uses PyPI Trusted Publishing (OIDC) — no API token is stored in the repo.
5
+ # One-time setup on PyPI (https://pypi.org/manage/account/publishing/):
6
+ # project name: badr
7
+ # owner: AdaptiveDecisionMakingGroup
8
+ # repository: badr
9
+ # workflow: release.yml
10
+ # environment: pypi
11
+
12
+ on:
13
+ release:
14
+ types: [published]
15
+
16
+ jobs:
17
+ build:
18
+ name: Build distribution
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.11"
25
+ - name: Build sdist and wheel
26
+ run: |
27
+ python -m pip install --upgrade build
28
+ python -m build
29
+ - name: Check metadata
30
+ run: |
31
+ python -m pip install --upgrade twine
32
+ python -m twine check dist/*
33
+ - uses: actions/upload-artifact@v4
34
+ with:
35
+ name: dist
36
+ path: dist/
37
+
38
+ publish:
39
+ name: Publish to PyPI
40
+ needs: build
41
+ runs-on: ubuntu-latest
42
+ environment:
43
+ name: pypi
44
+ url: https://pypi.org/project/badr/
45
+ permissions:
46
+ id-token: write # required for Trusted Publishing
47
+ steps:
48
+ - uses: actions/download-artifact@v4
49
+ with:
50
+ name: dist
51
+ path: dist/
52
+ - name: Publish
53
+ uses: pypa/gh-action-pypi-publish@release/v1
badr-0.1.0/.gitignore ADDED
@@ -0,0 +1,32 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # Virtual env
30
+ .venv
31
+
32
+
@@ -0,0 +1,20 @@
1
+ # Read the Docs build configuration
2
+ # https://docs.readthedocs.io/en/stable/config-file/v2.html
3
+ version: 2
4
+
5
+ build:
6
+ os: ubuntu-24.04
7
+ tools:
8
+ python: "3.11"
9
+
10
+ # Build the MkDocs site from the project's mkdocs.yml
11
+ mkdocs:
12
+ configuration: mkdocs.yml
13
+
14
+ python:
15
+ install:
16
+ # MkDocs + Material theme + mkdocstrings
17
+ - requirements: docs/requirements.txt
18
+ # Install badr itself so mkdocstrings can import it for the API reference
19
+ - method: pip
20
+ path: .