4747# ' contain the model. Use `graph_model` to access the trained [`Graph`] after `$train()`. Read-only.
4848# ' * `graph_model` :: [`Learner`][mlr3::Learner]\cr
4949# ' [`Graph`] that is being wrapped. This [`Graph`] contains a trained state after `$train()`. Read-only.
50- # ' * `inner_tuned_values ` :: named `list()` or `NULL`\cr
51- # ' The inner tuned parameter values.
52- # ' `NULL` is returned if the learner is not trained or none of the wrapped learners supports inner tuning.
53- # ' * `inner_valid_scores ` :: named `list()` or `NULL`\cr
54- # ' The inner tuned parameter values.
50+ # ' * `internal_tuned_values ` :: named `list()` or `NULL`\cr
51+ # ' The internal tuned parameter values.
52+ # ' `NULL` is returned if the learner is not trained or none of the wrapped learners supports internal tuning.
53+ # ' * `internal_valid_scores ` :: named `list()` or `NULL`\cr
54+ # ' The internal tuned parameter values.
5555# ' `NULL` is returned if the learner is not trained or none of the wrapped learners supports internal validation.
56- # ' * `validate` :: `numeric(1)`, `"inner_valid "`, `"test"` or `NULL`\cr
56+ # ' * `validate` :: `numeric(1)`, `"predefined "`, `"test"` or `NULL`\cr
5757# ' How to construct the validation data. This also has to be configured in the individual learners wrapped by
5858# ' `PipeOpLearner`, see [`set_validate.GraphLearner`] on how to configure this.
5959# '
@@ -111,10 +111,10 @@ GraphLearner = R6Class("GraphLearner", inherit = Learner,
111111 assert_subset(task_type , mlr_reflections $ task_types $ type )
112112
113113 private $ .can_validate = some(learner_wrapping_pipeops(graph ), function (po ) " validation" %in% po $ learner $ properties )
114- private $ .can_inner_tuning = some(learner_wrapping_pipeops(graph ), function (po ) " inner_tuning " %in% po $ learner $ properties )
114+ private $ .can_internal_tuning = some(learner_wrapping_pipeops(graph ), function (po ) " internal_tuning " %in% po $ learner $ properties )
115115
116116 properties = setdiff(mlr_reflections $ learner_properties [[task_type ]],
117- c(" validation" , " inner_tuning " )[! c(private $ .can_validate , private $ .can_inner_tuning )])
117+ c(" validation" , " internal_tuning " )[! c(private $ .can_validate , private $ .can_internal_tuning )])
118118
119119 super $ initialize(id = id , task_type = task_type ,
120120 feature_types = mlr_reflections $ task_feature_types ,
@@ -153,13 +153,13 @@ GraphLearner = R6Class("GraphLearner", inherit = Learner,
153153 }
154154 ),
155155 active = list (
156- inner_valid_scores = function (rhs ) {
156+ internal_valid_scores = function (rhs ) {
157157 assert_ro_binding(rhs )
158- self $ state $ inner_valid_scores
158+ self $ state $ internal_valid_scores
159159 },
160- inner_tuned_values = function (rhs ) {
160+ internal_tuned_values = function (rhs ) {
161161 assert_ro_binding(rhs )
162- self $ state $ inner_tuned_values
162+ self $ state $ internal_tuned_values
163163 },
164164 validate = function (rhs ) {
165165 if (! missing(rhs )) {
@@ -212,25 +212,25 @@ GraphLearner = R6Class("GraphLearner", inherit = Learner,
212212 .graph = NULL ,
213213 .validate = NULL ,
214214 .can_validate = NULL ,
215- .can_inner_tuning = NULL ,
216- .extract_inner_tuned_values = function () {
215+ .can_internal_tuning = NULL ,
216+ .extract_internal_tuned_values = function () {
217217 if (! private $ .can_validate ) return (NULL )
218218 itvs = unlist(map(
219219 learner_wrapping_pipeops(self $ graph_model ), function (po ) {
220- if (exists(" inner_tuned_values " , po $ learner )) {
221- po $ learner_model $ inner_tuned_values
220+ if (exists(" internal_tuned_values " , po $ learner )) {
221+ po $ learner_model $ internal_tuned_values
222222 }
223223 }
224224 ), recursive = FALSE )
225225 if (is.null(itvs ) || ! length(itvs )) return (named_list())
226226 itvs
227227 },
228- .extract_inner_valid_scores = function () {
229- if (! private $ .can_inner_tuning ) return (NULL )
228+ .extract_internal_valid_scores = function () {
229+ if (! private $ .can_internal_tuning ) return (NULL )
230230 ivs = unlist(map(
231231 learner_wrapping_pipeops(self $ graph_model ), function (po ) {
232- if (exists(" inner_valid_scores " , po $ learner )) {
233- po $ learner_model $ inner_valid_scores
232+ if (exists(" internal_valid_scores " , po $ learner )) {
233+ po $ learner_model $ internal_valid_scores
234234 }
235235 }
236236 ), recursive = FALSE )
@@ -314,11 +314,11 @@ GraphLearner = R6Class("GraphLearner", inherit = Learner,
314314# ' 2. On the level of the [`Learner`]s that are wrapped by [`PipeOpLearner`] and [`PipeOpLearnerCV`], which specifies
315315# ' which pipeops actually make use of the validation data.
316316# ' All learners wrapped by [`PipeOpLearner`] and [`PipeOpLearnerCV`] should in almost all cases either set it
317- # ' to `NULL` (disable) or `"inner_valid "` (enable).
317+ # ' to `NULL` (disable) or `"predefined "` (enable).
318318# '
319319# ' @param learner ([`GraphLearner`])\cr
320320# ' The graph learner to configure.
321- # ' @param validate (`numeric(1)`, `"inner_valid "`, `"test"`, or `NULL`)\cr
321+ # ' @param validate (`numeric(1)`, `"predefined "`, `"test"`, or `NULL`)\cr
322322# ' How to set the `$validate` field of the learner.
323323# ' If set to `NULL` all validation is disabled, both on the graph learner level, but also for all pipeops.
324324# ' @param ids (`NULL` or `character()`)\cr
@@ -384,7 +384,7 @@ set_validate.GraphLearner = function(learner, validate, ids = NULL, args = list(
384384 walk(ids , function (poid ) {
385385 # learner might be another GraphLearner / AutoTuner so we call into set_validate() again
386386 withCallingHandlers({
387- invoke(set_validate , learner = learner $ graph $ pipeops [[poid ]]$ learner , .args = insert_named(list (validate = " inner_valid " ), args [[poid ]]))
387+ invoke(set_validate , learner = learner $ graph $ pipeops [[poid ]]$ learner , .args = insert_named(list (validate = " predefined " ), args [[poid ]]))
388388 }, error = function (e ) {
389389 e $ message = sprintf(" Failed to set validate for PipeOp '%s':\n %s" , poid , e $ message )
390390 stop(e )
@@ -401,12 +401,12 @@ set_validate.GraphLearner = function(learner, validate, ids = NULL, args = list(
401401
402402
403403# ' @export
404- disable_inner_tuning .GraphLearner = function (learner , ids , ... ) {
404+ disable_internal_tuning .GraphLearner = function (learner , ids , ... ) {
405405 pvs = learner $ param_set $ values
406406 on.exit({learner $ param_set $ values = pvs }, add = TRUE )
407407 if (length(ids )) {
408408 walk(learner_wrapping_pipeops(learner ), function (po ) {
409- disable_inner_tuning (po $ learner , ids = po $ param_set $ ids()[sprintf(" %s.%s" , po $ id , po $ param_set $ ids()) %in% ids ])
409+ disable_internal_tuning (po $ learner , ids = po $ param_set $ ids()[sprintf(" %s.%s" , po $ id , po $ param_set $ ids()) %in% ids ])
410410 })
411411 }
412412 on.exit()
0 commit comments