From ab808722af26df8503fd96eac5287a314b88e342 Mon Sep 17 00:00:00 2001 From: jreps Date: Tue, 17 Dec 2024 12:36:01 -0500 Subject: [PATCH] fixing FeatureEngineering bug the FeatureEngineering was getting the featureEngineering settings from the trainData rather than the trainData$covariateData --- R/CyclopsModels.R | 2 +- R/KNN.R | 2 +- R/RClassifier.R | 2 +- R/SklearnClassifier.R | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/CyclopsModels.R b/R/CyclopsModels.R index 760f151d8..a576b74e7 100644 --- a/R/CyclopsModels.R +++ b/R/CyclopsModels.R @@ -188,7 +188,7 @@ fitCyclopsModel <- function( model = modelTrained, preprocessing = list( - featureEngineering = attr(trainData, "metaData")$featureEngineering,#learned mapping + featureEngineering = attr(trainData$covariateData, "metaData")$featureEngineering,#learned mapping tidyCovariates = attr(trainData$covariateData, "metaData")$tidyCovariateDataSettings, #learned mapping requireDenseMatrix = F ), diff --git a/R/KNN.R b/R/KNN.R index 834b26eaa..36e197e4f 100644 --- a/R/KNN.R +++ b/R/KNN.R @@ -123,7 +123,7 @@ fitKNN <- function(trainData, modelSettings, search = 'none', analysisId, ...){ model = indexFolder, preprocessing = list( - featureEngineering = attr(trainData, "metaData")$featureEngineering,#learned mapping + featureEngineering = attr(trainData$covariateData, "metaData")$featureEngineering,#learned mapping tidyCovariates = attr(trainData$covariateData, "metaData")$tidyCovariateDataSettings, #learned mapping requireDenseMatrix = F ), diff --git a/R/RClassifier.R b/R/RClassifier.R index a74e2358b..74f22704a 100644 --- a/R/RClassifier.R +++ b/R/RClassifier.R @@ -60,7 +60,7 @@ fitRclassifier <- function( model = cvResult$model, preprocessing = list( - featureEngineering = attr(trainData, "metaData")$featureEngineering, + featureEngineering = attr(trainData$covariateData, "metaData")$featureEngineering, tidyCovariates = attr(trainData$covariateData, "metaData")$tidyCovariateDataSettings, requireDenseMatrix = F ), diff --git a/R/SklearnClassifier.R b/R/SklearnClassifier.R index df45f866b..09643aa1b 100644 --- a/R/SklearnClassifier.R +++ b/R/SklearnClassifier.R @@ -91,7 +91,7 @@ fitSklearn <- function(trainData, result <- list( model = file.path(outLoc), preprocessing = list( - featureEngineering = attr(trainData, "metaData")$featureEngineering, + featureEngineering = attr(trainData$covariateData, "metaData")$featureEngineering, tidyCovariates = attr(trainData$covariateData, "metaData")$tidyCovariateDataSettings, requireDenseMatrix = attr(param, "settings")$requiresDenseMatrix ),