We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
old code:
#' @description Plots the history. #' @param measures (`character()`)\cr #' Which measures to plot. No default. #' @param set (`character(1)`)\cr #' Which set to plot. Either `"train"` or `"valid"`. Default is `"valid"`. #' @param epochs (`integer()`)\cr #' An integer vector restricting which epochs to plot. Default is `NULL`, which plots all epochs. #' @param theme ([ggplot2::theme()])\cr #' The theme, [ggplot2::theme_minimal()] is the default. #' @param ... (any)\cr #' Currently unused. plot = function(measures, set = "valid", epochs = NULL, theme = ggplot2::theme_minimal(), ...) { assert_choice(set, c("valid", "train")) data = self[[set]] assert_subset(measures, colnames(data)) if (is.null(epochs)) { data = data[, c("epoch", measures), with = FALSE] } else { assert_integerish(epochs, unique = TRUE) data = data[get("epoch") %in% epochs, c("epoch", measures), with = FALSE] } if ((!nrow(data)) || (ncol(data) < 2)) { stopf("No eligible measures to plot for set '%s'.", set) } epoch = score = measure = .data = NULL if (ncol(data) == 2L) { ggplot2::ggplot(data = data, ggplot2::aes(x = epoch, y = .data[[measures]])) + ggplot2::geom_line() + ggplot2::geom_point() + ggplot2::labs( x = "Epoch", y = measures, title = sprintf("%s Loss", switch(set, valid = "Validation", train = "Training")) ) + theme } else { data = melt(data, id.vars = "epoch", variable.name = "measure", value.name = "score") ggplot2::ggplot(data = data, ggplot2::aes(x = epoch, y = score, color = measure)) + viridis::scale_color_viridis(discrete = TRUE) + ggplot2::geom_line() + ggplot2::geom_point() + ggplot2::labs( x = "Epoch", y = "Score", title = sprintf("%s Loss", switch(set, valid = "Validation", train = "Training")) ) + theme }
Sorry, something went wrong.
this should dispatch on LearnerTorch
LearnerTorch
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: