1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/usr/bin/env Rscript
load (sprintf ("%s/data/feature_selection_lizeo.Rdata", Sys.getenv ("ABS_TOP_SRCDIR")))
Sys.setlocale ("LC_ALL", "fr_FR.UTF-8")
library ("magrittr")
plot <- (feature_selection_lizeo
%>% dplyr::filter (algorithm %in% c ("rsms_full", "rsms"))
%>% dplyr::mutate (algorithm = ifelse (algorithm == "rsms_full", "\\textbf{par époques}", algorithm))
%>% dplyr::mutate (algorithm = ifelse (algorithm == "rsms", "par sous-ensemble", algorithm))
%>% dplyr::mutate (`Nombre de variables` = n_features / max (n_features))
%>% dplyr::select (`Variante` = algorithm, `Nombre de variables`, `aRMSE` = armse)
%>% dplyr::group_by (Variante, `Nombre de variables`)
%>% dplyr::summarize (aRMSE = min (aRMSE))
%>% ggplot2::ggplot (ggplot2::aes (x = `Nombre de variables`, y = aRMSE, color = Variante, linetype = Variante))
+ ggplot2::geom_line ()
+ ggplot2::scale_linetype_manual (values = c ("\\textbf{par époques}" = "solid", "par sous-ensemble" = "dashed"))
+ ggplot2::scale_color_manual (values = c ("\\textbf{par époques}" = "#0072B2", "par sous-ensemble" = "#E69F00"))
+ ggplot2::scale_x_continuous (trans = 'log10', labels = scales::percent))
filename <- Sys.getenv ("OUTPUT")
ggplot2::ggsave (filename, plot, device = "svg", width = 6, height = 3)
|