Skip to content

Clean up Causal Analysis of Success in Modern Society Tutorial #472#473

Open
bkk8403 wants to merge 3 commits intogpsaggese:masterfrom
bkk8403:clean_up_causal_success_tutorial
Open

Clean up Causal Analysis of Success in Modern Society Tutorial #472#473
bkk8403 wants to merge 3 commits intogpsaggese:masterfrom
bkk8403:clean_up_causal_success_tutorial

Conversation

@bkk8403
Copy link
Copy Markdown
Contributor

@bkk8403 bkk8403 commented Apr 6, 2026

Related to #472

Summary

This PR brings the Causal Analysis of Success tutorial into compliance with
the tutorials_checklist.md and X_in_60_mins.format_rules.md standards.

Notebooks were renamed from underscore to dot convention so that
causal_success_API becomes causal_success.API and causal_success_example
becomes causal_success.example, matching the naming pattern used across all
other tutorials. All internal cross-references were updated accordingly.

The Dockerfile was rewritten against the python:3.12-slim template from
class_project/project_template, replacing the previous ubuntu:24.04 base.
Dependencies in requirements.txt are now pinned and grouped by section.

Heavy logic that was previously defined inline in the notebooks, including
DML fitting, Causal Forest estimation, policy comparison, and a policy
runner helper, has been moved into causal_success_utils.py. The notebooks
now only orchestrate and display results, as required by the format rules.

All markdown across the project, covering the README, the how-to guide, and
every notebook cell, was rewritten as flowing prose. Typos identified across
both notebooks were corrected.

Several missing files were added. An init.py makes the directory a proper
package. A .dockerignore was copied from the project template. A
test/test_docker_all.py was created for Docker-based notebook execution tests.
The conftest.py no longer blanket-disables test collection. Unit tests were
written for the three new utility functions.

The README was trimmed to 34 lines and now includes a Quick Start section and
a changelog. The how-to guide path references were updated to reflect the
actual directory location.

Both notebooks were verified to run end-to-end inside Docker without errors.

Test plan

Build the Docker image with ./docker_build.sh, then launch Jupyter with
./docker_jupyter.sh. Open causal_success.API.ipynb first and run all cells,
which should complete in two to three minutes. Then open
causal_success.example.ipynb and run all cells, which takes five to ten
minutes because of the DML and Causal Forest fitting. Both should produce
output without tracebacks.

@bkk8403 bkk8403 closed this Apr 7, 2026
@bkk8403 bkk8403 reopened this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant