R/plot_iteration_results.R

Defines functions plotIterationResults

plotIterationResults = function(iterationResultsAggr) {
  plot = ggplot2::ggplot(iterationResultsAggr, ggplot2::aes(x = fw.abs, y = acc, colour = method)) +
    ggplot2::geom_line() +
    ggplot2::theme_linedraw() +
    ggplot2::xlab("Number of Features") +
    ggplot2::ylab("Accuracy") +
    ggplot2::theme(
      legend.position = "none",
      text = ggplot2::element_text(size = 16)
    )

  # create a plot with two rows when only one data set is selected
  # otherwise create grid
  if(length(unique(iterationResultsAggr$dataset)) > 1) {
    plot = plot + ggplot2::facet_grid(dataset~classifier, scales = "free_x",)
  }
  else {
    plot = plot + ggplot2::facet_wrap(~ classifier, ncol = 2)
  }

  return((plot))
}
creil94/FeatureSelectionDashboard documentation built on Nov. 4, 2019, 9:17 a.m.