augment_user_tested: Nearest wrapper

Description Usage Arguments Value Examples

View source: R/augmenters.R

Description

This function is wrapper to nearest, adding is_covered to the model. This function is explicit about inputs, and is useful in cross validation - evaluating how test data performs against suggested facilities in the training set. This might be added to nearest, and may become obsolete.

Usage

1
augment_user_tested(all_facilities, test_data, distance_threshold = 100)

Arguments

all_facilities

data.frame Facilities selected in maxcovr model

test_data

data.frame test data (but it could be any user-type data)

distance_threshold

numeric

Value

dataframe containing distances between each test data observation and the nearest facility.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 

mc_cv_relocate_n100_cut %>%
  mutate(user_nearest_test = map2(
    .x = facilities_selected,
    .y = test,
    .f = augment_user_tested
    ))


## End(Not run)

njtierney/copertura documentation built on Nov. 13, 2019, 6:37 p.m.