Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to mkdocs #81

Draft
wants to merge 59 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6986e8b
Remove sphinx specific formatting, adjust heading syntax
thomasmarwitz Aug 14, 2024
42e6728
Add mkdocs deps and 'mkdocs' task.
thomasmarwitz Aug 14, 2024
820cec2
Add configuration to demonstrate rendering a jupyter notebook
thomasmarwitz Aug 14, 2024
c969414
Reorder examples to match order in sphinx. Skip costly optuna jn exec…
thomasmarwitz Aug 15, 2024
fcd9c27
first version of mk
thomasmarwitz Aug 20, 2024
cec7bcc
Custom gitignore for docs
thomasmarwitz Aug 20, 2024
aa4a768
Remove sphinx remnant
thomasmarwitz Aug 20, 2024
b31cfef
Add katex
thomasmarwitz Aug 20, 2024
c033799
Update math
thomasmarwitz Aug 20, 2024
4bfa36d
Fix list intendation
thomasmarwitz Aug 20, 2024
c7b65b1
Reindent, remove escaped subscript
thomasmarwitz Aug 27, 2024
454188f
Dedent
thomasmarwitz Aug 27, 2024
c365a7e
Fix subscript
thomasmarwitz Aug 27, 2024
2bab924
Translate 'motivation' to markdown
thomasmarwitz Aug 27, 2024
469eb6d
Translate 'faq' to markdown
thomasmarwitz Aug 27, 2024
97db606
Remove sphinx specific stuff
thomasmarwitz Aug 28, 2024
b541f4a
Add changelog and docu
thomasmarwitz Aug 28, 2024
8c10e02
Port development to md
thomasmarwitz Aug 28, 2024
69039cb
Port glossary to md
thomasmarwitz Aug 28, 2024
8b87b2b
fix symlink
thomasmarwitz Aug 28, 2024
28ad620
Port glossary to md
thomasmarwitz Aug 28, 2024
0dbc7d6
Beautiful highlight for target
thomasmarwitz Aug 28, 2024
bcd0f26
Format bullets as headings to be able to link to them
thomasmarwitz Aug 28, 2024
ae34f8c
Fix links
thomasmarwitz Aug 28, 2024
fd71674
Index page for examples
thomasmarwitz Aug 28, 2024
e5de470
Fix some math
thomasmarwitz Aug 28, 2024
97c6bac
Index more like sphinx
thomasmarwitz Aug 28, 2024
6380591
Add checkboxes example in motivation
thomasmarwitz Aug 28, 2024
b10dbfa
Fix enumeration
thomasmarwitz Aug 28, 2024
ed7beed
Add missing links to glossary
thomasmarwitz Aug 28, 2024
3f025b6
Adapt readthedocks
thomasmarwitz Aug 28, 2024
6398c73
Add 'development' to nav
thomasmarwitz Aug 28, 2024
dd612a0
Fix links
thomasmarwitz Aug 28, 2024
41b7067
Adapt pixi doc-related tasks
thomasmarwitz Aug 28, 2024
c73af9d
Fix links
thomasmarwitz Aug 28, 2024
6ffc86a
Enable sphinx-like behavior through mkdocstrings-python extension
thomasmarwitz Nov 5, 2024
bcb8a96
Remove custom target css, add note what this css selector does
thomasmarwitz Nov 5, 2024
d3ea328
Fix math and math in enumerations (with indentation)
thomasmarwitz Nov 26, 2024
d31a6f3
Remove index.rst again.
thomasmarwitz Nov 26, 2024
2f97cde
Use list like format as in sphinx
thomasmarwitz Nov 26, 2024
776776c
Mirror sphinx layout
thomasmarwitz Nov 26, 2024
a612331
Actual indent
thomasmarwitz Nov 26, 2024
2950de8
Add checkboxes in motivation part
thomasmarwitz Nov 26, 2024
a5a1340
Revert
thomasmarwitz Nov 26, 2024
b2a4ff4
Indent
thomasmarwitz Nov 26, 2024
bbffee8
Prettier
thomasmarwitz Nov 26, 2024
ff0f33a
Update docs/styles/custom.css
thomasmarwitz Nov 29, 2024
79d26f5
Use lower case bool values
thomasmarwitz Nov 29, 2024
ba4a38e
Adjust pixi docs tasks
thomasmarwitz Nov 29, 2024
fad29ae
Resolve link to notebook
thomasmarwitz Nov 29, 2024
dc4b9d7
Remove target css selector
thomasmarwitz Nov 29, 2024
40023fb
Fixes
thomasmarwitz Nov 29, 2024
412ba6e
Adapt to mkdocs style (links, code, math)
thomasmarwitz Nov 29, 2024
4ab14a3
Set indent to 4 in prettier for markdown.
thomasmarwitz Dec 3, 2024
a5a6fc3
--wip-- [skip ci]
thomasmarwitz Dec 3, 2024
2bf8bd1
Check output cells of notebooks
thomasmarwitz Dec 10, 2024
7fbabd5
Check outputs of example notebooks in CI.
thomasmarwitz Dec 13, 2024
2ef89f1
Add outputs
thomasmarwitz Dec 13, 2024
1bf0671
Fix bash for loop with default option
thomasmarwitz Dec 13, 2024
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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Checklist

- [ ] Added a `CHANGELOG.rst` entry
- [ ] Added a `CHANGELOG.rst` entry
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure

mypy-example-nbs:
name: Check notebooks mypy
check-example-nbs:
name: Check notebooks mypy and output exists
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
Expand All @@ -48,6 +48,9 @@ jobs:
run: |
pixi run nb-convert
pixi run nb-mypy
- name: Check output exists
run: |
pixi run nb-assert-output

unit-tests:
name: Unit Tests
Expand Down
10 changes: 9 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
"bracketSpacing": true,
"printWidth": 200,
"endOfLine": "auto",
"tabWidth": 2
"tabWidth": 2,
"overrides": [
{
"files": "*.md",
"options": {
"tabWidth": 4
}
}
]
}
4 changes: 1 addition & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ build:
commands:
- mamba install -c conda-forge -c nodefaults pixi
- pixi run -e docs postinstall
- pixi run -e docs docs
- pixi run -e docs docs-build
- pixi run -e docs readthedocs
sphinx:
configuration: docs/conf.py
formats:
- pdf
116 changes: 116 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Changelog

## 0.11.0 (2024-09-05)

### New features

- Add support for using `scipy.sparse.csr_matrix` as datastructure for covariates `X`.

## 0.10.0 (2024-08-13)

### New features

- Add abstract method [`MetaLearner.predict_conditional_average_outcomes`][metalearners.metalearner.MetaLearner.predict_conditional_average_outcomes] to [`metalearners.metalearner.MetaLearner`][metalearners.metalearner.MetaLearner].
- Implement [`RLearner.predict_conditional_average_outcomes`][metalearners.rlearner.RLearner.predict_conditional_average_outcomes] for [`metalearners.rlearner.RLearner`][metalearners.rlearner.RLearner].

### Bug fixes

- Fix bug in which the [`metalearners.slearner.SLearner`][metalearners.slearner.SLearner]'s inference step would have some leakage in the in-sample scenario.

## 0.9.0 (2024-08-02)

### New features

- Add [`MetaLearner.init_args`][metalearners.metalearner.MetaLearner.init_args].
- Add [`FixedBinaryPropensity`][metalearners.utils.FixedBinaryPropensity].
- 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].
- Add `MetaLearner._necessary_onnx_models`.
- 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.

## 0.8.0 (2024-07-22)

### New features

- Add [`MetaLearner.fit_all_nuisance`][metalearners.metalearner.MetaLearner.fit_all_nuisance] and [`MetaLearner.fit_all_treatment`][metalearners.metalearner.MetaLearner.fit_all_treatment].
- Add optional `store_raw_results` and `store_results` parameters to [`MetaLearnerGridSearch`][metalearners.grid_search.MetaLearnerGridSearch].
- Renamed `_GSResult` to [`GSResult`][metalearners.grid_search.GSResult].
- Added `grid_size_` attribute to [`MetaLearnerGridSearch`][metalearners.grid_search.MetaLearnerGridSearch].
- Implement [`CrossFitEstimator.score`][metalearners.cross_fit_estimator.CrossFitEstimator.score].

### Bug fixes

- Fixed a bug in [`MetaLearner.evaluate`][metalearners.metalearner.MetaLearner.evaluate] where it failed in the case of `feature_set` being different from `None`.

## 0.7.0 (2024-07-12)

### New features

- Add optional `adaptive_clipping` parameter to [`DRLearner`][metalearners.drlearner.DRLearner].

### Other changes

- Change the index columns order in `MetaLearnerGridSearch.results_`.
- Raise a custom error if only one class is present in a classification outcome.
- Raise a custom error if there are some treatment variants which have seen classification outcomes that have not appeared for some other treatment variant.

## 0.6.0 (2024-07-08)

### New features

- Implement [`MetaLearnerGridSearch`][metalearners.grid_search.MetaLearnerGridSearch].
- 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].

### Other changes

- Increase the lower bound on `scikit-learn` from 1.3 to 1.4.
- Drop the run dependency on `git_root`.

## 0.5.0 (2024-06-18)

- No longer raise an error if `feature_set` is provided to [`SLearner`][metalearners.slearner.SLearner].
- 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.

## 0.4.2 (2024-06-18)

- Ship license file.

## 0.4.1 (2024-06-18)

- Fix dependencies for pip.

## 0.4.0 (2024-06-18)

- Implemented [`CrossFitEstimator.clone`][metalearners.cross_fit_estimator.CrossFitEstimator.clone].
- Added `n_jobs_base_learners` to [`MetaLearner.fit`][metalearners.metalearner.MetaLearner.fit].
- Renamed [`Explainer.feature_importances`][metalearners.explainer.Explainer.feature_importances]. Note this is a breaking change.
- Renamed [`MetaLearner.feature_importances`][metalearners.metalearner.MetaLearner.feature_importances]. Note this is a breaking change.
- Renamed [`Explainer.shap_values`][metalearners.explainer.Explainer.shap_values]. Note this is a breaking change.
- Renamed [`MetaLearner.shap_values`][metalearners.metalearner.MetaLearner.shap_values]. Note this is a breaking change.
- Renamed [`MetaLearner.explainer`][metalearners.metalearner.MetaLearner.explainer]. Note this is a breaking change.
- Implemented `synchronize_cross_fitting` parameter for [`MetaLearner.fit`][metalearners.metalearner.MetaLearner.fit].
- Implemented `cv` parameter for [`CrossFitEstimator.fit`][metalearners.cross_fit_estimator.CrossFitEstimator.fit].

## 0.3.0 (2024-06-03)

- Implemented [`Explainer`][metalearners.explainer.Explainer] with support for binary classification and regression outcomes and discrete treatment variants.
- Integration of [`Explainer`][metalearners.explainer.Explainer] with [`MetaLearner`][metalearners.metalearner.MetaLearner] for feature importance and SHAP values calculations.
- Implemented model reuse through the `fitted_nuisance_models` and `fitted_propensity_model` parameters of [`MetaLearner`][metalearners.metalearner.MetaLearner].
- Allow for `fit_params` in [`MetaLearner.fit`][metalearners.metalearner.MetaLearner.fit].

## 0.2.0 (2024-05-28)

Beta release with:

- [`DRLearner`][metalearners.drlearner.DRLearner] with support for binary classification and regression outcomes and discrete treatment variants.
- Generalization of [`TLearner`][metalearners.tlearner.TLearner], [`XLearner`][metalearners.xlearner.XLearner], and [`RLearner`][metalearners.rlearner.RLearner] to allow for more than two discrete treatment variants.
- Unification of shapes returned by `predict` methods.
- [`simplify_output`][metalearners.utils.simplify_output] and [`metalearner_factory`][metalearners.utils.metalearner_factory].

## 0.1.0 (2024-05-16)

Alpha release with:

- [`TLearner`][metalearners.tlearner.TLearner] with support for binary classification and regression outcomes and binary treatment variants.
- [`SLearner`][metalearners.slearner.SLearner] with support for binary classification and regression outcomes and discrete treatment variants.
- [`XLearner`][metalearners.xlearner.XLearner] with support for binary classification and regression outcomes and binary treatment variants.
- [`RLearner`][metalearners.rlearner.RLearner] with support for binary classification and regression outcomes and binary treatment variants.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ MetaLearners for Conditional Average Treatment Effect (CATE) estimation

The library focuses on providing

- Methodologically sound cross-fitting
- Convenient access to and reuse of base models
- Consistent APIs across Metalearners
- Support for more than binary treatment variants
- Integrations with `pandas`, `shap`, `lime`, `optuna` and soon `onnx`
- Methodologically sound cross-fitting
- Convenient access to and reuse of base models
- Consistent APIs across Metalearners
- Support for more than binary treatment variants
- Integrations with `pandas`, `shap`, `lime`, `optuna` and soon `onnx`

## Example

Expand Down
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore artifacts created during notebook execution
***.onnx
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

30 changes: 0 additions & 30 deletions docs/_static/custom.css

This file was deleted.

3 changes: 3 additions & 0 deletions docs/api_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# API Documentation

::: metalearners
Loading
Loading