Skip to content

Commit

Permalink
Fix no visible binding for global variable notes
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Sep 15, 2020
1 parent 8e7b062 commit 2483b4e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ import(mlr3)
import(mlr3misc)
import(paradox)
importFrom(R6,R6Class)
importFrom(utils,combn)
importFrom(utils,head)
7 changes: 4 additions & 3 deletions R/FSelectorRFE.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ FSelectorRFE = R6Class("FSelectorRFE",
if (length(feature_names) - archive$n_batch < pars$min_features) break

if (pars$recursive) {

# Recalculate the variable importance on the reduced feature subset
feat = archive$data()[batch_nr == archive$n_batch, feature_names,
feat = archive$data()[get("batch_nr") == archive$n_batch, feature_names,
with = FALSE]
feat = feature_names[as.logical(feat)]

uhash = archive$data()[batch_nr == archive$n_batch, uhash]
uhash = archive$data()[get("batch_nr") == archive$n_batch, uhash]
rr = archive$benchmark_result$resample_result(uhash = uhash)
learners = rr$learners
imp = importance_average(learners, feat)
Expand All @@ -91,7 +92,7 @@ FSelectorRFE = R6Class("FSelectorRFE",
} else {
if (archive$n_batch == 1) {
# Calculate the variable importance on the complete feature subset
uhash = archive$data()[batch_nr == 1, uhash]
uhash = archive$data()[get("batch_nr") == 1, uhash]
rr = archive$benchmark_result$resample_result(uhash = uhash)
learners = rr$learners

Expand Down
2 changes: 1 addition & 1 deletion R/FSelectorSequential.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ FSelectorSequential = R6Class("FSelectorSequential",
if (inst$archive$n_batch == 0L) {
stop("No results stored in archive")
}
inst$archive$data()[, head(.SD, 1), by = batch_nr]
inst$archive$data()[, head(.SD, 1), by = get("batch_nr")]
}
),
private = list(
Expand Down
1 change: 1 addition & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' @import mlr3
#' @import bbotk
#' @importFrom R6 R6Class
#' @importFrom utils combn head
"_PACKAGE"

.onLoad = function(libname, pkgname) {
Expand Down

0 comments on commit 2483b4e

Please sign in to comment.