1. Create a virtual environment
2. Activate the virtual environment
4. Install project dependencies
A. Generate Synthetic Data
python -m scripts.generate_synthetic_vision_data --n_samples 10000 --output_filename vision_data.csv --data_dir data
python -m scripts.generate_synthetic_kidney_stone_data --output_filename kidney_data.csv --data_dir data
B. Run Rung 1 (Association)
python -m scripts.run_rung1 [FLAGS]
--data_path : Path to CSV data file. Default: ./data/kidney_data.csv
--treatment_col : Column name for treatment. Default: Treatment
--condition_col : Column name for condition. Default: Stone_Size
--outcome_col : Column name for outcome. Default: Success
--stratify : If provided, results are stratified by the condition variable.
python -m scripts.run_rung1 --data_path ./data/kidney_data.csv --stratify
C. Run Rung 2 (Intervention)
python -m scripts.run_rung2 [FLAGS]
--data_path : Path to CSV data file. Default: ./data/kidney_data.csv
--random_seed : Seed for reproducibility. Default: 42
--treatment_col : Column name for treatment. Default: Treatment
--condition_col : Column name for condition. Default: Stone_Size
--outcome_col : Column name for outcome. Default: Success
python -m scripts.run_rung2 --data_path ./data/kidney_data.csv --treatment_col Treatment --outcome_col Success
D. Run Rung 3 (Counterfactual)
python -m scripts.run_rung3 [FLAGS]
--data_path : Path to CSV data file. Default: ./data/vision_data.csv
--sample_condition : The specific condition value of the patient. Default: 1
--sample_treatment : The actual treatment the patient received. Default: 2
--sample_outcome : The actual outcome the patient experienced. Default: 0.883874
--new_treatments : Space-separated list of alternative treatments to simulate. Default: 0 1
--treatment_col : Column name for treatment. Default: Treatment
--condition_col : Column name for condition. Default: Condition
--outcome_col : Column name for outcome. Default: Vision
python -m scripts.run_rung3 --data_path ./data/vision_data.csv --sample_condition 1 --sample_treatment 2 --sample_outcome 0.88 --new_treatments 0 1