Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ Suggests:
rpart,
testthat,
titanic
Remotes:
mlr-org/mlr3misc@repr
RdMacros: mlr3misc
Encoding: UTF-8
LazyData: true
Expand Down
4 changes: 3 additions & 1 deletion R/Learner.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
#' @family Learner
#' @export
Learner = R6Class("Learner",
inherit = Representable_In_Dict,
public = list(
id = NULL,
state = NULL,
Expand All @@ -216,7 +217,6 @@ Learner = R6Class("Learner",

initialize = function(id, task_type, param_set = ParamSet$new(), predict_types = character(), feature_types = character(),
properties = character(), data_formats = "data.table", packages = character(), man = NA_character_) {

self$id = assert_string(id, min.chars = 1L)
self$task_type = assert_choice(task_type, mlr_reflections$task_types$type)
private$.param_set = assert_param_set(param_set)
Expand All @@ -228,6 +228,7 @@ Learner = R6Class("Learner",
self$data_formats = assert_subset(data_formats, mlr_reflections$data_formats)
self$packages = assert_set(packages)
self$man = assert_string(man, na.ok = TRUE)
super$initialize()
},

help = function() {
Expand Down Expand Up @@ -353,6 +354,7 @@ Learner = R6Class("Learner",
.encapsulate = NULL,
.predict_type = NULL,
.param_set = NULL,
.repr_dictionary = "lrn",

deep_clone = function(name, value) {
switch(name,
Expand Down