Clean up Causal Analysis of Success in Modern Society Tutorial #472#473
Open
bkk8403 wants to merge 3 commits intogpsaggese:masterfrom
Open
Clean up Causal Analysis of Success in Modern Society Tutorial #472#473bkk8403 wants to merge 3 commits intogpsaggese:masterfrom
bkk8403 wants to merge 3 commits intogpsaggese:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.