Tianxi Huang
This repo generates the report figures and runs the RQ3 statistical analysis from a single cleaned dataset.
graph.py: creates publication-ready figures and saves them toreports/figures/.project.ipynb: end-to-end notebook (ETL/modeling/analysis) and saves summary CSVs for plotting.cleaned_data/: input CSVs for figures (e.g.,top_predictors_rq1.csv,roi_merged_full.csv,listings_unified_clean.csv) and RQ3 outputs saved by the notebook (rq3_price_summary.csv,rq3_license_share.csv, etc.).reports/figures/: output images.
Install dependencies:
pip install -r requirements.txtEnsure these folders exist (create them if missing):
# from the project root
New-Item -ItemType Directory -Force .\cleaned_data | Out-Null
New-Item -ItemType Directory -Force .\reports\figures | Out-NullAll dependencies tested on Window PC.
Option A — VS Code:
- Open
project.ipynbin VS Code. - Select the Python kernel you installed (Python 3.12 recommended).
- Run
All cellstop-to-bottom. This will produce the RQ3 CSVs incleaned_data/automatically. - When it finishes, run:
python .\graph.py
Option B — Jupyter:
- Launch Jupyter
- Open
project.ipynb, use Run All, wait for completion, then in a terminal runpython .\graph.py.
From the project root:
python .\graph.pyThis will create:
fig_rq1_rf_importance.pngfig_rq2_roi_top10_all.pngfig_rq2_roi_top_vancouver.pngfig_rq2_roi_top_victoria.pngfig_rq3_avg_price_prepost.png(requirescleaned_data/rq3_price_summary.csv)fig_rq3_license_share_prepost.png(requirescleaned_data/rq3_license_share.csv)
- If geospatial installs fail, you can still run RQ1/RQ2/RQ3 figures without GeoPandas. Only the mapping cells in the notebook need GeoPandas/Shapely.
- Ensure
cleaned_data/listings_unified_clean.csvis present; otherwise, the RQ3 cell cannot run.
Free to use/modify.