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

Format

R6::R6Class object.

Construction

l = Log$new(log = NULL)
  • log :: data.table::data.table()
    Table with columns "class" (allowed values are "output", "warning", and "error") and "message".

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

# 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)) learner$fallback = mlr_learners$get("classif.featureless") e = Experiment$new(task, learner) e$train(ctrl = list(encapsulate_train = "evaluate"))
#> INFO [mlr3] Training learner 'debug' on task 'sonar' ...
l = e$logs$train l$has_condition("error")
#> [1] TRUE
#> <Log> with 2 messages: #> 1: [output] Message from classif.debug->train() #> 2: [error] Error from classif.debug->train()