/
server.R
121 lines (94 loc) · 3.86 KB
/
server.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Launch from console
# R -e "shiny::runApp()"
library(shiny)
library(ggplot2)
library(gridExtra)
load(file="data/algos_family.Rda")
load(file="data/results.Rda")
load(file="data/results_ranking.Rda")
load(file="data/info_tables.Rda")
load(file="data/stats_bin.Rda")
load(file="data/stats_all.Rda")
source("src/plot_best_algos.R")
source("src/plot_comparison_families.R")
source("src/plot_comparison_best.R")
source("src/plot_weighted_acc.R")
source("src/plot_bin_multi_comparison.R")
source("src/plot_comparison_implementation.R")
load(file="data/algos.Rda")
selected_algos <- split(algos$Algorithm, algos$FullName)
colors <- setNames(as.vector(algos$color), algos$Algorithm)
shinyServer(function(input, output) {
# Execute the slides.html in the intro
output$slides <- renderUI({
tags$iframe(src = "slides.html",height=800, width=1124 )
})
# Filter the algorithms by family and implementation
output$table_algos <- renderDataTable({
if ((input$family1 == "ALL") & (input$implementation1 == "ALL")){
algos_family
} else if (input$family1 == "ALL") {
algos_family[which(algos_family$Implementation == input$implementation1),]
}else if (input$implementation1 == "ALL"){
algos_family[which(algos_family$Family == input$family1),]
} else {
algos_family[which((algos_family$Implementation == input$implementation1) & (algos_family$Family == input$family1)) ,]
}
}, options = list(paging = FALSE, pageLength = -1, searching = FALSE))
# Render UI Results - Friedman ranking if results by family
output$ui <- renderUI({
switch(input$table_by,
"Algorithm" = selectInput("family2", h4("Algorithm Family:"),
choices = c("ALL", sort(unique(algos_family$Family)))),
"Family" = br()
)
})
output$ui2 <- renderUI({
switch(input$table_by,
"Algorithm" = selectInput("implementation2", h4("Algorithm Implementation:"),
choices = c("ALL", sort(unique(algos_family$Implementation)))),
"Family" = br()
)
})
# Friedman ranking results, filter by family
output$table <- renderDataTable({
if (input$filter_binary == "All"){
temp <- stats_all
} else {
temp <- stats_bin
}
if (is.null(input$family2))
return(temp[, c(5,3,4,1,2)])
if ((input$family2 == "ALL") & (input$implementation2 == "ALL")){
temp[, c(6,3,4,5,1,2)]
} else if (input$family2 == "ALL") {
temp[, c(6,3,4,5,1,2)][which(temp$Implementation == input$implementation2),]
}else if (input$implementation2 == "ALL"){
temp[, c(6,3,4,5,1,2)][which(temp$Family == input$family2),]
} else {
temp[, c(6,3,4,5,1,2)][which((temp$Implementation == input$implementation2) & (temp$Family == input$family2)) ,]
}
}, options = list(pageLength = 15, searching = FALSE))
# Plot comparison algorithms and implementations
output$table_plot_family = renderPlot({
plot_comparison_families(stats_all, stats_bin, input$filter_binary)
})
output$plot_per_best_acc = renderPlot({
# a <- c("parRF_caret", "svm_C", "elm_kernel_matlab")
a <- input$best_acc_by2
plot_best_algos(a, results_ranking, info_tables, input$filter_binary, colors)
})
output$plot_comparison = renderPlot({
a <- input$best_acc_by3
plot_comparison_best(a,selected_algos,colors,results_ranking,info_tables,input$filter_binary)
})
output$plot_weighted = renderPlot({
plot_weighted_acc(selected_algos,colors,results_ranking,info_tables,input$weighted,input$filter_binary)
})
output$plot_bin_multi = renderPlot({
plot_bin_multi_comparison(stats_all, stats_bin, selected_algos,colors,input$comparison_by4)
})
output$plot_implementation = renderPlot({
plot_comparison_implementation(stats_all, stats_bin, input$filter_binary, input$by_family5)
})
})