Skip to content

Commit daeadc2

Browse files
thomasmarwitzpavelzwkklein
authored
Migrate to mkdocs (#81)
* Remove sphinx specific formatting, adjust heading syntax * Add mkdocs deps and 'mkdocs' task. * Add configuration to demonstrate rendering a jupyter notebook * Reorder examples to match order in sphinx. Skip costly optuna jn execution. * first version of mk * Custom gitignore for docs * Remove sphinx remnant * Add katex * Update math * Fix list intendation * Reindent, remove escaped subscript * Dedent * Fix subscript * Translate 'motivation' to markdown * Translate 'faq' to markdown * Remove sphinx specific stuff * Add changelog and docu * Port development to md * Port glossary to md * fix symlink * Port glossary to md * Beautiful highlight for target * Format bullets as headings to be able to link to them * Fix links * Index page for examples * Fix some math * Index more like sphinx * Add checkboxes example in motivation * Fix enumeration * Add missing links to glossary * Adapt readthedocks * Add 'development' to nav * Fix links * Adapt pixi doc-related tasks * Fix links * Enable sphinx-like behavior through mkdocstrings-python extension * Remove custom target css, add note what this css selector does * Fix math and math in enumerations (with indentation) * Remove index.rst again. Forgot during rebase. * Use list like format as in sphinx * Mirror sphinx layout * Actual indent * Add checkboxes in motivation part * Revert * Indent * Prettier * Update docs/styles/custom.css Co-authored-by: Pavel Zwerschke <[email protected]> * Use lower case bool values * Adjust pixi docs tasks * Resolve link to notebook * Remove target css selector * Fixes * Adapt to mkdocs style (links, code, math) * Set indent to 4 in prettier for markdown. This is necessary for prettier not to break math rendering which only works when indented 0 or 4 spaces. * Changes * Check output cells of notebooks * Check outputs of example notebooks in CI. Check via execution count in a bash script. * Add outputs * Fix bash for loop with default option * Capitalize bullets * Fix headings of mkdocs not rendering if code block * Fix code reference * Fix all {term} refs to glossary in notebooks * Remove sphinx specific identifiers for refs. Add mkdocs warnings * Fix notes / warnings * Fix {ref} in notebooks * Fix {math} in notebooks * Fix two remaining note blocks * Fix docstrings sphinx format * Remove execute ignore since no notebook is executed. * Fix sphinx class and method-like references * Open external links in new tab * Update lockfile * Fix pre-commit * correct math in docs/background.md Co-authored-by: Kevin Klein <[email protected]> * Update docs/parallelism.md Co-authored-by: Kevin Klein <[email protected]> * Correct Math Co-authored-by: Kevin Klein <[email protected]> * Add smarty extension for dash rendering via '--'. * Disable protected method rendering in docs * Correct image * Fix method reference name Co-authored-by: Kevin Klein <[email protected]> * Fix title * Fix image in notebook * Add 12.0 in md changelog, get rid of rst changelog * precommit fixes * Provide svg files with white background. * Integrate dark mode images, add padding * Add reference link to snippet * Add reference to link snippet * site_desc and site_url for SEO * Remove unecessary / cleared things * Pre-commit * Remove unnecessary ignores * Replace black with ruff * Removing log * Bash script improvements Co-authored-by: Pavel Zwerschke <[email protected]> * FUrhter bash improvements * Make nb script executable * Fix bash script invokation Co-authored-by: Pavel Zwerschke <[email protected]> * Improve bash script Co-authored-by: Pavel Zwerschke <[email protected]> * Restore typical line break behavior in code output --------- Co-authored-by: Pavel Zwerschke <[email protected]> Co-authored-by: Kevin Klein <[email protected]> Co-authored-by: kklein <[email protected]>
1 parent db0828a commit daeadc2

Some content is hidden

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

67 files changed

+4399
-4148
lines changed

.github/workflows/ci.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535
- name: pre-commit
3636
run: pixi run pre-commit-run --color=always --show-diff-on-failure
3737

38-
mypy-example-nbs:
39-
name: Check notebooks mypy
38+
check-example-nbs:
39+
name: Check notebooks mypy and output exists
4040
timeout-minutes: 5
4141
runs-on: ubuntu-latest
4242
steps:
@@ -48,6 +48,9 @@ jobs:
4848
run: |
4949
pixi run nb-convert
5050
pixi run nb-mypy
51+
- name: Check output exists
52+
run: |
53+
pixi run nb-assert-output
5154
5255
unit-tests:
5356
name: Unit Tests

.prettierrc

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,13 @@
33
"bracketSpacing": true,
44
"printWidth": 200,
55
"endOfLine": "auto",
6-
"tabWidth": 2
6+
"tabWidth": 2,
7+
"overrides": [
8+
{
9+
"files": "*.md",
10+
"options": {
11+
"tabWidth": 4
12+
}
13+
}
14+
]
715
}

.readthedocs.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ build:
66
commands:
77
- mamba install -c conda-forge -c nodefaults pixi
88
- pixi run -e docs postinstall
9-
- pixi run -e docs docs
9+
- pixi run -e docs docs-build
1010
- pixi run -e docs readthedocs
11-
sphinx:
12-
configuration: docs/conf.py
1311
formats:
1412
- pdf

CHANGELOG.md

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<!-- Versioning follows semantic versioning, see also
2+
https://semver.org/spec/v2.0.0.html. The most important bits are:
3+
* Update the major if you break the public API
4+
* Update the minor if you add new functionality
5+
* Update the patch if you fixed a bug -->
6+
7+
# Changelog
8+
9+
## 0.12.0 (2025-01-29)
10+
11+
### Other changes
12+
13+
- Comply with `scikit-learn` versions 1.6 and higher.
14+
15+
## 0.11.0 (2024-09-05)
16+
17+
### New features
18+
19+
- Add support for using `scipy.sparse.csr_matrix` as datastructure for covariates `X`.
20+
21+
## 0.10.0 (2024-08-13)
22+
23+
### New features
24+
25+
- Add abstract method [`MetaLearner.predict_conditional_average_outcomes`][metalearners.metalearner.MetaLearner.predict_conditional_average_outcomes] to [`metalearners.metalearner.MetaLearner`][metalearners.metalearner.MetaLearner].
26+
- Implement [`RLearner.predict_conditional_average_outcomes`][metalearners.rlearner.RLearner.predict_conditional_average_outcomes] for [`metalearners.rlearner.RLearner`][metalearners.rlearner.RLearner].
27+
28+
### Bug fixes
29+
30+
- Fix bug in which the [`metalearners.slearner.SLearner`][metalearners.slearner.SLearner]'s inference step would have some leakage in the in-sample scenario.
31+
32+
## 0.9.0 (2024-08-02)
33+
34+
### New features
35+
36+
- Add [`MetaLearner.init_args`][metalearners.metalearner.MetaLearner.init_args].
37+
- Add [`FixedBinaryPropensity`][metalearners.utils.FixedBinaryPropensity].
38+
- Add `MetaLearner._build_onnx` to [`metalearners.MetaLearner`][metalearners.metalearner.MetaLearner] abstract class and implement it for [`TLearner`][metalearners.tlearner.TLearner], [`XLearner`][metalearners.xlearner.XLearner], [`RLearner`][metalearners.rlearner.RLearner], and [`DRLearner`][metalearners.drlearner.DRLearner].
39+
- Add `MetaLearner._necessary_onnx_models`.
40+
- Add [`DRLearner.average_treatment_effect`][metalearners.drlearner.DRLearner.average_treatment_effect] to compute the AIPW point estimate and standard error for average treatment effects (ATE) without requiring a full model fit.
41+
42+
## 0.8.0 (2024-07-22)
43+
44+
### New features
45+
46+
- Add [`MetaLearner.fit_all_nuisance`][metalearners.metalearner.MetaLearner.fit_all_nuisance] and [`MetaLearner.fit_all_treatment`][metalearners.metalearner.MetaLearner.fit_all_treatment].
47+
- Add optional `store_raw_results` and `store_results` parameters to [`MetaLearnerGridSearch`][metalearners.grid_search.MetaLearnerGridSearch].
48+
- Renamed `_GSResult` to [`GSResult`][metalearners.grid_search.GSResult].
49+
- Added `grid_size_` attribute to [`MetaLearnerGridSearch`][metalearners.grid_search.MetaLearnerGridSearch].
50+
- Implement [`CrossFitEstimator.score`][metalearners.cross_fit_estimator.CrossFitEstimator.score].
51+
52+
### Bug fixes
53+
54+
- Fixed a bug in [`MetaLearner.evaluate`][metalearners.metalearner.MetaLearner.evaluate] where it failed in the case of `feature_set` being different from `None`.
55+
56+
## 0.7.0 (2024-07-12)
57+
58+
### New features
59+
60+
- Add optional `adaptive_clipping` parameter to [`DRLearner`][metalearners.drlearner.DRLearner].
61+
62+
### Other changes
63+
64+
- Change the index columns order in `MetaLearnerGridSearch.results_`.
65+
- Raise a custom error if only one class is present in a classification outcome.
66+
- Raise a custom error if there are some treatment variants which have seen classification outcomes that have not appeared for some other treatment variant.
67+
68+
## 0.6.0 (2024-07-08)
69+
70+
### New features
71+
72+
- Implement [`MetaLearnerGridSearch`][metalearners.grid_search.MetaLearnerGridSearch].
73+
- Add a `scoring` parameter to [`MetaLearner.evaluate`][metalearners.metalearner.MetaLearner.evaluate] and implement the abstract method for [`XLearner`][metalearners.xlearner.XLearner] and [`DRLearner`][metalearners.drlearner.DRLearner].
74+
75+
### Other changes
76+
77+
- Increase the lower bound on `scikit-learn` from 1.3 to 1.4.
78+
- Drop the run dependency on `git_root`.
79+
80+
## 0.5.0 (2024-06-18)
81+
82+
- No longer raise an error if `feature_set` is provided to [`SLearner`][metalearners.slearner.SLearner].
83+
- Fix a bug where base model dictionaries -- e.g., `n_folds` or `feature-set` -- were improperly initialized if the provided dictionary's keys were a strict superset of the expected keys.
84+
85+
## 0.4.2 (2024-06-18)
86+
87+
- Ship license file.
88+
89+
## 0.4.1 (2024-06-18)
90+
91+
- Fix dependencies for pip.
92+
93+
## 0.4.0 (2024-06-18)
94+
95+
- Implemented [`CrossFitEstimator.clone`][metalearners.cross_fit_estimator.CrossFitEstimator.clone].
96+
- Added `n_jobs_base_learners` to [`MetaLearner.fit`][metalearners.metalearner.MetaLearner.fit].
97+
- Renamed [`Explainer.feature_importances`][metalearners.explainer.Explainer.feature_importances]. Note this is a breaking change.
98+
- Renamed [`MetaLearner.feature_importances`][metalearners.metalearner.MetaLearner.feature_importances]. Note this is a breaking change.
99+
- Renamed [`Explainer.shap_values`][metalearners.explainer.Explainer.shap_values]. Note this is a breaking change.
100+
- Renamed [`MetaLearner.shap_values`][metalearners.metalearner.MetaLearner.shap_values]. Note this is a breaking change.
101+
- Renamed [`MetaLearner.explainer`][metalearners.metalearner.MetaLearner.explainer]. Note this is a breaking change.
102+
- Implemented `synchronize_cross_fitting` parameter for [`MetaLearner.fit`][metalearners.metalearner.MetaLearner.fit].
103+
- Implemented `cv` parameter for [`CrossFitEstimator.fit`][metalearners.cross_fit_estimator.CrossFitEstimator.fit].
104+
105+
## 0.3.0 (2024-06-03)
106+
107+
- Implemented [`Explainer`][metalearners.explainer.Explainer] with support for binary classification and regression outcomes and discrete treatment variants.
108+
- Integration of [`Explainer`][metalearners.explainer.Explainer] with [`MetaLearner`][metalearners.metalearner.MetaLearner] for feature importance and SHAP values calculations.
109+
- Implemented model reuse through the `fitted_nuisance_models` and `fitted_propensity_model` parameters of [`MetaLearner`][metalearners.metalearner.MetaLearner].
110+
- Allow for `fit_params` in [`MetaLearner.fit`][metalearners.metalearner.MetaLearner.fit].
111+
112+
## 0.2.0 (2024-05-28)
113+
114+
Beta release with:
115+
116+
- [`DRLearner`][metalearners.drlearner.DRLearner] with support for binary classification and regression outcomes and discrete treatment variants.
117+
- Generalization of [`TLearner`][metalearners.tlearner.TLearner], [`XLearner`][metalearners.xlearner.XLearner], and [`RLearner`][metalearners.rlearner.RLearner] to allow for more than two discrete treatment variants.
118+
- Unification of shapes returned by `predict` methods.
119+
- [`simplify_output`][metalearners.utils.simplify_output] and [`metalearner_factory`][metalearners.utils.metalearner_factory].
120+
121+
## 0.1.0 (2024-05-16)
122+
123+
Alpha release with:
124+
125+
- [`TLearner`][metalearners.tlearner.TLearner] with support for binary classification and regression outcomes and binary treatment variants.
126+
- [`SLearner`][metalearners.slearner.SLearner] with support for binary classification and regression outcomes and discrete treatment variants.
127+
- [`XLearner`][metalearners.xlearner.XLearner] with support for binary classification and regression outcomes and binary treatment variants.
128+
- [`RLearner`][metalearners.rlearner.RLearner] with support for binary classification and regression outcomes and binary treatment variants.

CHANGELOG.rst

-220
This file was deleted.

docs/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore artifacts created during notebook execution
2+
***.onnx

0 commit comments

Comments
 (0)