summary_mc_cv_relocate: Summary for max_coverage cross validation for relocation...

Description Usage Arguments Value Examples

Description

Summary for max_coverage cross validation for relocation models

Usage

1
summary_mc_cv_relocate(model, test_data)

Arguments

model

the cross validated model

test_data

the cross validated test data

Value

a summary dataframe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 

library(maxcovr)
library(tidyverse)

york_selected <- york %>% filter(grade == "I")
york_unselected <- york %>% filter(grade != "I")

mc_cv <- modelr::crossv_kfold(york_crime, 5) %>%
                 mutate(test = map(test,as_tibble),
                 train = map(train,as_tibble))

mc_cv_relocate <- map_df(mc_cv$train,
                    ~max_coverage_relocation(existing_facility = york_selected,
                               proposed_facility = york_unselected,
                               user = .,
                               cost_install = 2500,
                               cost_removal = 700,
                               cost_total = 50000,
                               distance_cutoff = 100,
                               solver = "gurobi"))

 summary_mc_cv_relocate(mc_cv_relocate, mc_cv$test)


## End(Not run)

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