From be72dbf278c4c8c6af0344f8c1665631c8bce301 Mon Sep 17 00:00:00 2001 From: rfl-urbaniak Date: Tue, 8 Oct 2024 01:57:32 -0400 Subject: [PATCH] preds to gitignore --- .gitignore | 1 + .../deployment/tracts_minneapolis/predict.py | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 242801f7..562fffe9 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ data/minneapolis/sourced/parcel_to_parking_info_mappings/** cities/deployment/tracts_minneapolis/tracts_model_guide.pkl cities/deployment/tracts_minneapolis/tracts_model_params.pth /build/ +docs/experimental_notebooks/zoning/interactions_preds.dill diff --git a/cities/deployment/tracts_minneapolis/predict.py b/cities/deployment/tracts_minneapolis/predict.py index c36a2dfb..2a0fdccd 100644 --- a/cities/deployment/tracts_minneapolis/predict.py +++ b/cities/deployment/tracts_minneapolis/predict.py @@ -228,16 +228,17 @@ def predict_cumulative(self, conn, intervention): predictor = TractsModelPredictor(conn) start = time.time() - result = predictor.predict_cumulative( - conn, - intervention={ - "radius_blue": 106.7, - "limit_blue": 0, - "radius_yellow_line": 402.3, - "radius_yellow_stop": 804.7, - "limit_yellow": 0.5, - "reform_year": 2015, - }, - ) + for iter in range(100): # added for time testing + result = predictor.predict_cumulative( + conn, + intervention={ + "radius_blue": 106.7, + "limit_blue": 0, + "radius_yellow_line": 402.3, + "radius_yellow_stop": 804.7, + "limit_yellow": 0.5, + "reform_year": 2015, + }, + ) end = time.time() print(f"Counterfactual in {end - start} seconds")