diff --git a/R/Dataset.R b/R/Dataset.R index a915214..bd3a8b5 100644 --- a/R/Dataset.R +++ b/R/Dataset.R @@ -52,7 +52,7 @@ Dataset <- torch::dataset( dt <- data.table::data.table(rows=dataCat$rowId, cols=dataCat$columnId) maxFeatures <- max(dt[, .N, by=rows][,N]) start <- Sys.time() - tensorList <- lapply(1:max(data %>% pull(rowId)), function(x) { + tensorList <- lapply(1:max(data %>% dplyr::pull(rowId)), function(x) { torch::torch_tensor(dt[rows==x, cols]) }) self$lengths <- lengths diff --git a/tests/testthat/test-DeepNNTorch.R b/tests/testthat/test-DeepNNTorch.R index 3c31541..af6492a 100644 --- a/tests/testthat/test-DeepNNTorch.R +++ b/tests/testthat/test-DeepNNTorch.R @@ -52,7 +52,7 @@ test_that("setDeepNNTorch with runPlp working checks", { testthat::expect_true('performanceEvaluation' %in% names(res)) # check prediction same size as pop - testthat::expect_equal(nrow(res$prediction %>% filter(evaluationType %in% c('Train', 'Test'))), + testthat::expect_equal(nrow(res$prediction %>% dplyr::filter(evaluationType %in% c('Train', 'Test'))), nrow(population)) # check prediction between 0 and 1 @@ -67,7 +67,7 @@ test_that("Triple layer-nn works", { epochs= c(5), seed=NULL) sink(nullfile()) - results <- fitDeepNNTorch(trainData$Train, deepset$param, analysisId=1) + results <- fitDeepNNTorch(trainData$Train, deepset, analysisId=1) sink() expect_equal(class(results), 'plpModel') diff --git a/tests/testthat/test-ResNet.R b/tests/testthat/test-ResNet.R index f05b4af..41e54d9 100644 --- a/tests/testthat/test-ResNet.R +++ b/tests/testthat/test-ResNet.R @@ -66,7 +66,8 @@ test_that("ResNet with runPlp working checks", { testthat::expect_true('performanceEvaluation' %in% names(res2)) # check prediction same size as pop - testthat::expect_equal(nrow(res2$prediction %>% filter(evaluationType %in% c('Train', 'Test'))), nrow(population)) + testthat::expect_equal(nrow(res2$prediction %>% + dplyr::filter(evaluationType %in% c('Train', 'Test'))), nrow(population)) # check prediction between 0 and 1 testthat::expect_gte(min(res2$prediction$value), 0) diff --git a/tests/testthat/test-dataset.R b/tests/testthat/test-dataset.R index 259d40e..e692ec8 100644 --- a/tests/testthat/test-dataset.R +++ b/tests/testthat/test-dataset.R @@ -6,7 +6,7 @@ test_that("length of index correct", { testthat::expect_equal( length(dataset$getNumericalIndex()), -n_distinct(mappedData$covariates %>% pull(covariateId))) +dplyr::n_distinct(mappedData$covariates %>% dplyr::pull(covariateId))) }) @@ -14,7 +14,7 @@ test_that("number of num and cat features sum correctly", { testthat::expect_equal( dataset$numNumFeatures()+dataset$numCatFeatures(), - n_distinct(mappedData$covariates %>% pull(covariateId)) + dplyr::n_distinct(mappedData$covariates %>% dplyr::pull(covariateId)) ) }) @@ -26,7 +26,7 @@ test_that("length of dataset correct", { expect_equal(length(dataset), dataset$num$shape[1]) expect_equal( dataset$.length(), - n_distinct(mappedData$covariates %>% pull(rowId)) + dplyr::n_distinct(mappedData$covariates %>% dplyr::pull(rowId)) ) })