Skip to content

Commit

Permalink
Merge branch '2025-assessment-year' into 7-revisit-condo-strata-imput…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
wrridgeway authored Jan 16, 2025
2 parents 9efaac3 + 30f3b60 commit 155fffc
Show file tree
Hide file tree
Showing 12 changed files with 403 additions and 205 deletions.
353 changes: 202 additions & 151 deletions dvc.lock

Large diffs are not rendered by default.

23 changes: 15 additions & 8 deletions params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,28 +168,32 @@ model:
- "prox_num_pin_in_half_mile"
- "prox_num_bus_stop_in_half_mile"
- "prox_num_foreclosure_per_1000_pin_past_5_years"
- "prox_num_school_in_half_mile"
- "prox_airport_dnl_total"
- "prox_nearest_bike_trail_dist_ft"
- "prox_nearest_cemetery_dist_ft"
- "prox_nearest_cta_route_dist_ft"
- "prox_nearest_cta_stop_dist_ft"
- "prox_nearest_hospital_dist_ft"
- "prox_lake_michigan_dist_ft"
- "prox_nearest_major_road_dist_ft"
- "prox_nearest_metra_route_dist_ft"
- "prox_nearest_metra_stop_dist_ft"
- "prox_nearest_park_dist_ft"
- "prox_nearest_railroad_dist_ft"
- "prox_nearest_secondary_road_dist_ft"
- "prox_nearest_university_dist_ft"
- "prox_nearest_vacant_land_dist_ft"
- "prox_nearest_water_dist_ft"
- "prox_nearest_golf_course_dist_ft"
- "prox_nearest_road_highway_dist_ft"
- "prox_nearest_road_arterial_dist_ft"
- "prox_nearest_road_collector_dist_ft"
- "prox_nearest_road_highway_daily_traffic"
- "prox_nearest_road_arterial_daily_traffic"
- "prox_nearest_road_collector_daily_traffic"
- "prox_nearest_new_construction_dist_ft"
- "prox_nearest_stadium_dist_ft"
- "acs5_percent_age_children"
- "acs5_percent_age_senior"
- "acs5_median_age_total"
- "acs5_percent_mobility_moved_from_other_state"
- "acs5_percent_household_family_married"
- "acs5_percent_household_nonfamily_alone"
- "acs5_percent_education_high_school"
Expand All @@ -203,11 +207,8 @@ model:
- "acs5_median_household_total_occupied_year_built"
- "acs5_median_household_renter_occupied_gross_rent"
- "acs5_percent_household_owner_occupied"
- "acs5_percent_household_total_occupied_w_sel_cond"
- "acs5_percent_mobility_moved_in_county"
- "other_tax_bill_rate"
- "ccao_is_active_exe_homeowner"
- "ccao_is_corner_lot"
- "ccao_n_years_exe_homeowner"
- "time_sale_year"
- "time_sale_day"
Expand All @@ -217,6 +218,12 @@ model:
- "time_sale_day_of_month"
- "time_sale_day_of_week"
- "time_sale_post_covid"
- "shp_parcel_centroid_dist_ft_sd"
- "shp_parcel_edge_len_ft_sd"
- "shp_parcel_interior_angle_sd"
- "shp_parcel_mrr_area_ratio"
- "shp_parcel_mrr_side_ratio"
- "shp_parcel_num_vertices"
- "meta_strata_1"
- "meta_strata_2"

Expand Down Expand Up @@ -390,4 +397,4 @@ ratio_study:
# upload
export:
triad_code: "1"
run_id: "2024-03-11-pensive-manasi"
run_id: "2025-01-11-practical-tristan"
2 changes: 2 additions & 0 deletions pipeline/05-finalize.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ purrr::walk(list.files("R/", "\\.R$", full.names = TRUE), source)
set.seed(NULL)




#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 2. Save Metadata -------------------------------------------------------------
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
16 changes: 8 additions & 8 deletions renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.4.1",
"Version": "4.4.2",
"Repositories": [
{
"Name": "CRAN",
Expand Down Expand Up @@ -279,11 +279,11 @@
"Version": "1.3.0",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "ccao-data",
"RemoteRepo": "ccao",
"RemoteRef": "master",
"RemoteSha": "6445f79e6b4207a174c22d7a139511cf8e2516b6",
"RemoteHost": "api.github.com",
"RemoteSha": "8b6f53e14c1732fcec5f6982fbc4bfb32f45f194",
"Requirements": [
"R",
"assessr",
Expand All @@ -292,11 +292,11 @@
"rlang",
"tidyr"
],
"Hash": "d452fba08dff15c8379f18aa03af084e"
"Hash": "1663306aa228ded9892f07d65ec20db3"
},
"class": {
"Package": "class",
"Version": "7.3-22",
"Version": "7.3-23",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -305,7 +305,7 @@
"stats",
"utils"
],
"Hash": "f91f6b29f38b8c280f2b9477787d4bb2"
"Hash": "d0cb9cc838c3b43560bd958fc4317fdc"
},
"cli": {
"Package": "cli",
Expand Down Expand Up @@ -1044,15 +1044,15 @@
},
"nnet": {
"Package": "nnet",
"Version": "7.3-19",
"Version": "7.3-20",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"stats",
"utils"
],
"Hash": "2c797b46eea7fb58ede195bc0b1f1138"
"Hash": "c955edf99ff24a32e96bd0a22645af60"
},
"numDeriv": {
"Package": "numDeriv",
Expand Down
24 changes: 12 additions & 12 deletions renv/profiles/reporting/renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.4.1",
"Version": "4.4.2",
"Repositories": [
{
"Name": "CRAN",
Expand Down Expand Up @@ -39,20 +39,20 @@
},
"KernSmooth": {
"Package": "KernSmooth",
"Version": "2.23-24",
"Version": "2.23-26",
"Source": "Repository",
"Repository": "CRAN",
"Repository": "RSPM",
"Requirements": [
"R",
"stats"
],
"Hash": "9f33a1ee37bbe8919eb2ec4b9f2473a5"
"Hash": "2fb39782c07b5ad422b0448ae83f64c4"
},
"MASS": {
"Package": "MASS",
"Version": "7.3-61",
"Version": "7.3-64",
"Source": "Repository",
"Repository": "CRAN",
"Repository": "RSPM",
"Requirements": [
"R",
"grDevices",
Expand All @@ -61,7 +61,7 @@
"stats",
"utils"
],
"Hash": "0cafd6f0500e5deba33be22c46bf6055"
"Hash": "49d2d8090b74c1179df1aff16201caf8"
},
"Matrix": {
"Package": "Matrix",
Expand Down Expand Up @@ -257,7 +257,7 @@
},
"class": {
"Package": "class",
"Version": "7.3-22",
"Version": "7.3-23",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
Expand All @@ -266,7 +266,7 @@
"stats",
"utils"
],
"Hash": "f91f6b29f38b8c280f2b9477787d4bb2"
"Hash": "d0cb9cc838c3b43560bd958fc4317fdc"
},
"classInt": {
"Package": "classInt",
Expand Down Expand Up @@ -1649,9 +1649,9 @@
},
"survival": {
"Package": "survival",
"Version": "3.7-0",
"Version": "3.8-3",
"Source": "Repository",
"Repository": "CRAN",
"Repository": "RSPM",
"Requirements": [
"Matrix",
"R",
Expand All @@ -1661,7 +1661,7 @@
"stats",
"utils"
],
"Hash": "5aaa9cbaf4aba20f8e06fdea1850a398"
"Hash": "fe42836742a4f065b3f3f5de81fccab9"
},
"svglite": {
"Package": "svglite",
Expand Down
33 changes: 15 additions & 18 deletions reports/_setup.qmd → reports/_setup.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
---
params:
run_id: "2024-02-08-dreamy-sam"
year: "2024"
---

```{r}
# This setup script is run at the top of each Quarto report subsection to load
# libraries, data, and other objects needed for the report. It only loads
# objects if they don't already exist in the environment, so it can be run
Expand Down Expand Up @@ -127,12 +120,14 @@ if (!exists("model_performance_test_linear")) {
arrow::read_parquet(paths$output$performance_test_linear$local)
}
if (!exists("model_performance_quantile_test")) {
# nolint start: object_length_linter
model_performance_quantile_test <-
arrow::read_parquet(paths$output$performance_quantile_test$local)
}
if (!exists("model_performance_quantile_test_linear")) {
model_performance_quantile_test_linear <-
arrow::read_parquet(paths$output$performance_quantile_test_linear$local)
# nolint end
}
if (!exists("model_performance_assessment")) {
model_performance_assessment <-
Expand All @@ -147,7 +142,7 @@ if (!exists("feat_imp_df")) {
}

# Load SHAP data if it exists (only exists for important runs)
if (file.exists(paths$output$shap$local) & metadata$shap_enable) {
if (file.exists(paths$output$shap$local) && metadata$shap_enable) {
shap_df <- read_parquet(paths$output$shap$local)
shap_exists <- nrow(shap_df) > 0
} else {
Expand All @@ -167,9 +162,7 @@ plot_colors <- list(
shorten_number <- function(x) {
scales::dollar(x, accuracy = 1, scale = 1 / 1000, suffix = "K")
}
```

```{r}
# Chunk to populate the metadata / dataset summaries in the text of each module
# Anything prefixed with m_ is a variable that will be used directly in the text
m_test_min_date <- min(test_card$meta_sale_date)
Expand All @@ -181,14 +174,18 @@ m_test_n_sales_triad <- test_card %>%
filter(meta_triad_code == run_triad_code) %>%
nrow() %>%
scales::comma()
m_test_n_sales_prop <-
(nrow(filter(test_card, meta_triad_code == run_triad_code)) /
nrow(test_card)) %>%
m_test_n_sales_prop <- (
nrow(filter(test_card, meta_triad_code == run_triad_code)) /
nrow(test_card)
) %>%
scales::percent(accuracy = 0.01)
m_test_med_sp <- test_card$meta_sale_price %>%
median() %>%
scales::dollar()
m_test_split_prop <- scales::percent(1 - metadata$cv_split_prop, accuracy = 0.01)
m_test_split_prop <- scales::percent(
1 - metadata$cv_split_prop,
accuracy = 0.01
)

m_train_min_date <- min(training_data$meta_sale_date)
m_train_max_date <- max(training_data$meta_sale_date)
Expand All @@ -199,9 +196,10 @@ m_train_n_sales_triad <- training_data %>%
filter(meta_triad_code == run_triad_code) %>%
nrow() %>%
scales::comma()
m_train_n_sales_prop <-
(nrow(filter(training_data, meta_triad_code == run_triad_code)) /
nrow(training_data)) %>%
m_train_n_sales_prop <- (
nrow(filter(training_data, meta_triad_code == run_triad_code)) /
nrow(training_data)
) %>%
scales::percent(accuracy = 0.01)
m_train_med_sp <- training_data$meta_sale_price %>%
median() %>%
Expand All @@ -228,4 +226,3 @@ m_assess_stage_near <- paste(
metadata$ratio_study_near_year,
metadata$ratio_study_near_stage
)
```
Loading

0 comments on commit 155fffc

Please sign in to comment.