Skip to content

Commit

Permalink
Test bagged tree strata imputation
Browse files Browse the repository at this point in the history
  • Loading branch information
wrridgeway committed Jan 16, 2025
1 parent 8fa78b0 commit 38952c2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions R/recipes.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ model_main_recipe <- function(data, pred_vars, cat_vars,
update_role_requirements("NA", bake = FALSE) %>%
# Remove any variables not an outcome var or in the pred_vars vector
step_rm(-all_outcomes(), -all_predictors(), -has_role("ID")) %>%
# Impute missing values using KNN. Specific to condo model, usually used to
# impute missing condo building strata. Within step_impute_knn, an estimated
# node value is called with the sample(). This is not deterministic, meaning
# different runs of the model will have different imputed values, and thus
# different FMVs.
step_impute_knn(
# Impute missing values using a bagged tree. Specific to condo model,
# usually used to impute missing condo building strata.
step_impute_bag(
all_of(knn_vars),

Check warning on line 36 in R/recipes.R

View workflow job for this annotation

GitHub Actions / pre-commit

file=/home/runner/work/model-condo-avm/model-condo-avm/R/recipes.R,line=36,col=6,[indentation_linter] Indentation should be 0 spaces but is 6 spaces.
neighbors = tune(),
trees = 25,
seed_val = params$input$strata$seed
impute_with = imp_vars(all_of(knn_imp_vars)),

Check warning on line 39 in R/recipes.R

View workflow job for this annotation

GitHub Actions / pre-commit

file=/home/runner/work/model-condo-avm/model-condo-avm/R/recipes.R,line=39,col=7,[error] unexpected symbol
options = list(
nthread = parallel::detectCores(logical = FALSE),

Check warning on line 41 in R/recipes.R

View workflow job for this annotation

GitHub Actions / pre-commit

file=/home/runner/work/model-condo-avm/model-condo-avm/R/recipes.R,line=41,col=8,[indentation_linter] Indentation should be 0 spaces but is 8 spaces.
Expand Down

0 comments on commit 38952c2

Please sign in to comment.