mabadgeley
r Sys.Date()
data(classifiers, package="MyClassifiers")
str(classifiers, list.len=2)
#> List of 2
#> $ classifier_points:List of 7
#> ..$ nlp_4 :Formal class 'ClassifierPoint' [package "MyClassifiers"] w..
#> .. .. ..@ Y_: logi [1:180] TRUE TRUE TRUE TRUE TRUE TRUE ...
#> .. .. ..@ Y : logi [1:180] FALSE FALSE TRUE TRUE TRUE TRUE ...
#> .. .. .. [list output truncated]
#> ..$ nlp_8 :Formal class 'ClassifierPoint' [package "MyClassifiers"] w..
#> .. .. ..@ Y_: logi [1:180] FALSE FALSE FALSE FALSE FALSE FALSE ...
#> .. .. ..@ Y : logi [1:180] FALSE FALSE TRUE TRUE TRUE TRUE ...
#> .. .. .. [list output truncated]
#> .. [list output truncated]
#> $ classifier_curves:List of 3
#> ..$ cnn_8 :Formal class 'ClassifierCurve' [package "MyClassifiers"] wit..
#> .. .. ..@ pY: num [1:180] 0.25347 0.65845 0.40168 0.76503 0.00696 ...
#> .. .. ..@ Y : logi [1:180] FALSE FALSE TRUE TRUE TRUE TRUE ...
#> .. .. .. [list output truncated]
#> ..$ cnn_10:Formal class 'ClassifierCurve' [package "MyClassifiers"] wit..
#> .. .. ..@ pY: num [1:180] 0.196 0.705 0.113 0.117 0.106 ...
#> .. .. ..@ Y : logi [1:180] FALSE FALSE TRUE TRUE TRUE TRUE ...
#> .. .. .. [list output truncated]
#> .. [list output truncated]
accumulate_gg_dots <- function(...) {
Reduce(`+`, list(...), accumulate=TRUE)
}
accumulate_gg_dots(
ggplot(mtcars, aes(x=disp, y=cyl)) + geom_point(),
geom_smooth(),
xlab(NULL),
ylab(NULL)
)
#> [[1]]
#>
#> [[2]]
#>
#> [[3]]
#>
#> [[4]]
tidy_curves <- map_dfr(classifiers$classifier_curves, tidy, .id="grader") %>%
nest(-id, -Y, .key = pY_by_grader)
tidy_points <- map_dfr(classifiers$classifier_point, tidy, .id = "grader") %>%
nest(-id, -Y, .key = Y_by_grader)
tidy_df <- inner_join(tidy_points, tidy_curves, c("id", "Y"))
tidy_df
tidy_df %>% `[`(1, ) %>% use_series(Y_by_grader) %>% kable
grader Y_
--------- ------
nlp_4 TRUE
nlp_8 FALSE
nlp_10 FALSE
javin FALSE
eko TRUE
mike TRUE
priority FALSE
tidy_df %>% `[`(1, ) %>% use_series(pY_by_grader) %>% kable
grader pY
------- -------
cnn_8 0.2535
cnn_10 0.1960
cnn_4 0.9916
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.