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 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

# 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"))
#> <Experiment> [trained]: #> + Task: sonar #> - Learner: [missing] #> - Model: [missing] #> - Predictions: [missing] #> - Performance: [missing]
l = e$log() print(l)
#> <Log> with 2 messages: #> [OUT] train: Message from classif.debug->train() #> [ERR] train: Error from classif.debug->train()
l$has_condition("error")
#> [1] TRUE