Scaling QQ plot. Commenting out bootstrapping.

This commit is contained in:
Corey Dow-Hygelund 2020-01-17 10:26:58 -08:00
Родитель 19a7cffe75
Коммит 60d3cb1c3d
2 изменённых файлов: 31 добавлений и 3 удалений

Просмотреть файл

@ -1,6 +1,7 @@
library(tidyr)
library(purrr)
library(lubridate)
# library(boot)
source('lib/scoring.R')
extract_health_metrics <- function(predictions, release, outcomes, v_n1){
@ -41,4 +42,30 @@ extract_health_metrics <- function(predictions, release, outcomes, v_n1){
mutate(version = v_n1)
return(health_metrics)
}
}
# bootstrap_mean <- function(predictions, release, metrics){
# agg_sets <- function(predictions){
# predictions %>%
# select(metrics) %>%
# gather("metric", "value") %>%
# group_by(metric) %>%
# summarise(
# mean = mean(value)
# ) %>%
# pull(mean)
# }
#
# bs_stat <- function(df, indices) {
# df_trim <- df[indices, ]
# predictions <- df_trim %>% filter(label == 'beta')
# release <- df_trim %>% filter(label == 'release')
# pred_agg <- agg_sets(predictions)
# # release_agg <- agg_sets(release[indices,])
# release_agg <- agg_sets(release)
# rel_diff <- (abs(pred_agg-release_agg)/release_agg)
# return(rel_diff)
# }
# return(boot(data=predictions %>% bind_rows(release), statistic=bs_stat,
# R=100, parallel = "multicore", ncpus = 2))
# }

Просмотреть файл

@ -43,8 +43,9 @@ plot.qq <- function(qq.df, response, ranges=NULL){
theme(axis.text.x = element_text(angle = 45, hjust = 1),
plot.title = element_text(size=10),
legend.position = c(0.8, 0.2)) +
# scale_x_continuous(limits = ranges$x) +
coord_cartesian(xlim = ranges$x)+
scale_x_continuous(limits = ranges$x) +
scale_y_continuous(limits = ranges$x) +
# coord_cartesian(xlim = ranges$x)+
ggtitle(response)
return(p_qq)