mlr3 (version 0.1.0-9000)

Log: Learner Output Log

Description

Object which stores the text output of the train or predict step of an Experiment.

Arguments

Format

R6::R6Class object.

Construction

l = Log$new(log = NULL)
  • log :: data.table::data.table() Table with at least the columns "class" (allowed values are "output", "warning", and "error") and "msg" (character()). A third column "context" is optional, and currently only used for printing.

Fields

  • warnings :: character(1) Vector of all messages of class "warning".

  • errors :: character(1) Vector of all messages of class "error".

Methods

  • has_condition(cl) character(1) -> logical(1) Returns TRUE if at least one message with condition cl has been recorded.

Examples

Run this code
# NOT RUN {
# Create a simple experiment and extract the train log:
task = mlr_tasks$get("sonar")
learner = mlr_learners$get("classif.debug",
  param_vals = list(message_train = TRUE, error_train = TRUE))
e = Experiment$new(task, learner)
e$train(ctrl = list(encapsulate_train = "evaluate"))
l = e$log()

print(l)
l$has_condition("error")
# }

Run the code above in your browser using DataLab