From f3340d9645f0ee90a69d28348f9e56636c5cb56a Mon Sep 17 00:00:00 2001 From: egillax Date: Thu, 7 Dec 2023 13:28:46 +0100 Subject: [PATCH] fix numerical features --- R/Estimator.R | 4 ++-- tests/testthat/test-Estimator.R | 2 +- tests/testthat/test-LRFinder.R | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/Estimator.R b/R/Estimator.R index 4ef2047..c3c6725 100644 --- a/R/Estimator.R +++ b/R/Estimator.R @@ -330,7 +330,7 @@ gridCvDeep <- function(mappedData, currentEstimatorSettings$modelType <- modelSettings$modelType currentModelParams$catFeatures <- dataset$get_cat_features()$max() currentModelParams$numFeatures <- - dataset$get_numerical_features()$max() + dataset$get_numerical_features()$len() if (findLR) { lrFinder <- createLRFinder(modelType = modelSettings$modelType, modelParameters = currentModelParams, @@ -402,7 +402,7 @@ gridCvDeep <- function(mappedData, } modelParams$catFeatures <- dataset$get_cat_features()$max() - modelParams$numFeatures <- dataset$get_numerical_features()$max() + modelParams$numFeatures <- dataset$get_numerical_features()$len() estimatorSettings <- fillEstimatorSettings(modelSettings$estimatorSettings, diff --git a/tests/testthat/test-Estimator.R b/tests/testthat/test-Estimator.R index ba82835..f277d0c 100644 --- a/tests/testthat/test-Estimator.R +++ b/tests/testthat/test-Estimator.R @@ -1,5 +1,5 @@ catFeatures <- smallDataset$dataset$get_cat_features()$max() -numFeatures <- smallDataset$dataset$get_numerical_features()$max() +numFeatures <- smallDataset$dataset$get_numerical_features()$len() modelParameters <- list( cat_features = catFeatures, diff --git a/tests/testthat/test-LRFinder.R b/tests/testthat/test-LRFinder.R index a42416b..5c46af8 100644 --- a/tests/testthat/test-LRFinder.R +++ b/tests/testthat/test-LRFinder.R @@ -36,7 +36,7 @@ test_that("LR finder works", { list(cat_features = dataset$get_cat_features()$max(), num_features = - dataset$get_numerical_features()$max(), + dataset$get_numerical_features()$len(), size_embedding = 32L, size_hidden = 64L, num_layers = 1L, @@ -64,7 +64,7 @@ test_that("LR finder works with device specified by a function", { model = "ResNet", modelParameters = list(cat_features = dataset$get_cat_features()$max(), - num_features = dataset$get_numerical_features()$max(), + num_features = dataset$get_numerical_features()$len(), size_embedding = 8L, size_hidden = 16L, num_layers = 1L,