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

Some more small fixes #3

Merged
merged 1 commit into from
Jan 25, 2025
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
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
- name: Render & Publish Docs
shell: bash -l {0}
run: |
set -e
source .venv/bin/activate
bash docs/marimo_examples_to_quarto.sh
quartodoc build --config docs/_quarto.yml
quarto render docs/

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">

<img src="docs/assets/main_logo.svg"" align="center" alt="CaML Logo" height="auto" width=500px/>
<img src="docs/assets/main_logo.svg" align="center" alt="CaML Logo" height="auto" width=500px/>

[![image](https://img.shields.io/pypi/v/caml.svg)](https://pypi.python.org/pypi/caml)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
Expand Down
15 changes: 9 additions & 6 deletions docs/03_Examples/Synthetic Data Generation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ data = CamlSyntheticDataGenerator(n_obs=10_000,
n_cont_confounders=1,
n_binary_confounders=1,
n_discrete_confounders=1,
n_cont_heterogeneity_covariates=1,
n_binary_heterogeneity_covariates=1,
n_discrete_heterogeneity_covariates=1,
n_heterogeneity_confounders=1,
n_cont_modifiers=1,
n_binary_modifiers=1,
n_discrete_modifiers=1,
n_confounding_modifiers=1,
stddev_outcome_noise=3,
stddev_treatment_noise=3,
causal_model_functional_form="fully_nonlinear",
causal_model_functional_form="linear",
n_nonlinear_transformations=10,
n_nonlinear_interactions=5,
seed=15)
Expand All @@ -46,7 +46,9 @@ data.df
## DGP

```{python}
data.dgp
for k,v in data.dgp.items():
print(k)
print(v)
```

## True Conditional Average Treatment Effects (CATEs)
Expand All @@ -60,3 +62,4 @@ data.cates
```{python}
data.ates
```

3 changes: 3 additions & 0 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ format:
table-scroll: true
code-fold: true

execute:
error: halt

website:
title: CaML - Causal ML
favicon: assets/logo_no_text.svg
Expand Down
48 changes: 25 additions & 23 deletions docs/assets/marimo/Synthetic Data Generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
}
},
"outputs": [],
"source": []
"source": [
"import marimo as mo"
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -47,27 +49,25 @@
"metadata": {},
"outputs": [],
"source": [
"data = CamlSyntheticDataGenerator(\n",
" n_obs=10_000,\n",
" n_cont_outcomes=1,\n",
" n_binary_outcomes=1,\n",
" n_cont_treatments=1,\n",
" n_binary_treatments=1,\n",
" n_discrete_treatments=1,\n",
" n_cont_confounders=1,\n",
" n_binary_confounders=1,\n",
" n_discrete_confounders=1,\n",
" n_cont_heterogeneity_covariates=1,\n",
" n_binary_heterogeneity_covariates=1,\n",
" n_discrete_heterogeneity_covariates=1,\n",
" n_heterogeneity_confounders=1,\n",
" stddev_outcome_noise=3,\n",
" stddev_treatment_noise=3,\n",
" causal_model_functional_form=\"fully_nonlinear\",\n",
" n_nonlinear_transformations=10,\n",
" n_nonlinear_interactions=5,\n",
" seed=15,\n",
")"
"data = CamlSyntheticDataGenerator(n_obs=10_000,\n",
" n_cont_outcomes=1,\n",
" n_binary_outcomes=1,\n",
" n_cont_treatments=1,\n",
" n_binary_treatments=1,\n",
" n_discrete_treatments=1,\n",
" n_cont_confounders=1,\n",
" n_binary_confounders=1,\n",
" n_discrete_confounders=1,\n",
" n_cont_modifiers=1,\n",
" n_binary_modifiers=1,\n",
" n_discrete_modifiers=1,\n",
" n_confounding_modifiers=1,\n",
" stddev_outcome_noise=3,\n",
" stddev_treatment_noise=3,\n",
" causal_model_functional_form=\"linear\",\n",
" n_nonlinear_transformations=10,\n",
" n_nonlinear_interactions=5,\n",
" seed=15)"
]
},
{
Expand Down Expand Up @@ -103,7 +103,9 @@
"metadata": {},
"outputs": [],
"source": [
"data.dgp"
"for k,v in data.dgp.items():\n",
" print(k)\n",
" print(v)"
]
},
{
Expand Down
17 changes: 6 additions & 11 deletions notebooks/examples/Synthetic Data Generation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import marimo

__generated_with = "0.10.4"
__generated_with = "0.10.15"
app = marimo.App(width="medium")


Expand Down Expand Up @@ -39,13 +39,13 @@ def _(CamlSyntheticDataGenerator):
n_cont_confounders=1,
n_binary_confounders=1,
n_discrete_confounders=1,
n_cont_heterogeneity_covariates=1,
n_binary_heterogeneity_covariates=1,
n_discrete_heterogeneity_covariates=1,
n_heterogeneity_confounders=1,
n_cont_modifiers=1,
n_binary_modifiers=1,
n_discrete_modifiers=1,
n_confounding_modifiers=1,
stddev_outcome_noise=3,
stddev_treatment_noise=3,
causal_model_functional_form="fully_nonlinear",
causal_model_functional_form="linear",
n_nonlinear_transformations=10,
n_nonlinear_interactions=5,
seed=15)
Expand Down Expand Up @@ -102,10 +102,5 @@ def _(data):
return


@app.cell
def _():
return


if __name__ == "__main__":
app.run()
Loading