Skip to content

Commit

Permalink
bump R requirement and switch as.data.frame to as.data.table per #375
Browse files Browse the repository at this point in the history
  • Loading branch information
nhejazi committed Jan 27, 2022
1 parent 74e98df commit 4d6a71e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Maintainer: Jeremy Coyle <jeremyrcoyle@gmail.com>
Description: A modern implementation of the Super Learner prediction algorithm,
coupled with a general-purpose framework for composing arbitrary pipelines
for machine learning tasks.
Depends: R (>= 2.14.0)
Depends: R (>= 3.1.0)
Imports:
data.table,
assertthat,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ importFrom(assertthat,is.count)
importFrom(assertthat,is.flag)
importFrom(caret,findLinearCombos)
importFrom(data.table,":=")
importFrom(data.table,as.data.table)
importFrom(data.table,data.table)
importFrom(data.table,set)
importFrom(data.table,setDT)
Expand Down
12 changes: 6 additions & 6 deletions R/sl3_Task.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#' Define a Machine Learning Task
#'
#' An increasingly less thin wrapper around a \code{data.table} containing the
#' data. Contains metadata about the particular machine learning problem,
#' including which variables are to be used as covariates and outcomes.
#' An increasingly thick wrapper around a \code{\link[data.table]{data.table}}
#' containing the data for a prediction task. This contains metadata about the
#' particular machine learning problem, including which variables are to be
#' used as covariates and outcomes.
#'
#' @docType class
#'
Expand All @@ -11,7 +12,7 @@
#' @importFrom origami make_folds
#' @importFrom uuid UUIDgenerate
#' @importFrom digest digest
#' @importFrom data.table data.table setcolorder setDT setnames ":="
#' @importFrom data.table as.data.table data.table setcolorder setDT setnames ":="
#'
#' @export
#'
Expand Down Expand Up @@ -173,8 +174,7 @@ sl3_Task <- R6Class(
Xmatch <- lapply(int, function(i) {
grep(i, colnames(self$X), value = TRUE)
})
#browser()
Xint <- as.list(as.data.frame(t(expand.grid(Xmatch))))
Xint <- as.list(data.table::as.data.table(t(expand.grid(Xmatch))))

d_Xint <- lapply(Xint, function(Xint) {
self$X[, prod.DT(.SD), .SD = Xint]
Expand Down
7 changes: 4 additions & 3 deletions man/sl3_Task.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4d6a71e

Please sign in to comment.