-
Notifications
You must be signed in to change notification settings - Fork 0
/
shiny.R
86 lines (71 loc) · 1.72 KB
/
shiny.R
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
depmap_gdc_fit <- import('depmap_gdc_fit')
data <- depmap_gdc_fit$merge()
model <- reactive({
depmap_gdc_fit$model(data, input$train_split, input$dims)
})
stats<-reactive({
model()$stats %>%
data.table %>%
{.[, train:=round(train, 2)]} %>%
{.[, test:=round(test, 2)]} %>%
{.[, rand:=round(rand, 2)]} %>%
{.[]} %>%
datatable_scroller(options=list(dom='t', scrollY=300), selection='single')
})
plot_data<-reactive({
.model <- model()
.idx <- req(input$stats_rows_selected)
.model$data(.idx-1)
})
plot_stats1<-reactive({
.model <- model()
.model$stats %>%
data.table(keep.rownames=TRUE) %>%
{
ggplot(., aes(train, test))+
geom_point()
}
})
plot_stats2<-reactive({
.model <- model()
.model$stats %>%
data.table(keep.rownames=TRUE) %>%
{
ggplot(., aes(sort(train), sort(rand)))+
geom_point()+
geom_abline(slope=1, intercept=0)
}
})
plot_data1<-reactive({
.data<-plot_data()
.data[[1]] %>%
data.table %>%
{
ggplot(., aes(pred, obs, text=CCLE_Name))+
geom_point()+
labs(title='train')
} %>%
ggplotly(tooltip=c('x', 'y', 'text'))
})
plot_data2<-reactive({
.data<-plot_data()
.data[[2]] %>%
data.table %>%
{
ggplot(., aes(pred, obs, text=CCLE_Name))+
geom_point()+
labs(title='train')
} %>%
ggplotly(tooltip=c('x', 'y', 'text'))
})
plot_data3<-reactive({
.data<-plot_data()
.data[[3]] %>%
data.table(keep.rownames=TRUE) %>%
{
ggplot(., aes(x=as.numeric(rn), y=expr, color=project_id, shape=is_normal))+
geom_point()+
labs(x='')
} %>%
ggplotly(tooltip=c('expr', 'project_id', 'is_normal'), height=500)
})