Skip to content

Commit

Permalink
fixing FeatureEngineering bug
Browse files Browse the repository at this point in the history
the FeatureEngineering was getting the featureEngineering settings from the trainData rather than the trainData$covariateData
  • Loading branch information
jreps committed Dec 17, 2024
1 parent fbea755 commit ab80872
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/CyclopsModels.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand Down
2 changes: 1 addition & 1 deletion R/KNN.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 126 in R/KNN.R

View check run for this annotation

Codecov / codecov/patch

R/KNN.R#L126

Added line #L126 was not covered by tests
tidyCovariates = attr(trainData$covariateData, "metaData")$tidyCovariateDataSettings, #learned mapping
requireDenseMatrix = F
),
Expand Down
2 changes: 1 addition & 1 deletion R/RClassifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand Down
2 changes: 1 addition & 1 deletion R/SklearnClassifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand Down

0 comments on commit ab80872

Please sign in to comment.