Skip to content

Commit

Permalink
fix issue (#434)
Browse files Browse the repository at this point in the history
preserve attributes when splitting data
  • Loading branch information
egillax authored Mar 27, 2024
1 parent 11122d4 commit 2b5f007
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*-Ex.R
# R data files from past sessions
.Rdata
# R environ
.Renviron
# RStudio files
.Rproj.user/
.Rproj.user
Expand All @@ -20,4 +22,4 @@ standalone/build/*
/plpmodels/*
/python_models/*
/mycache/*
/inst/shiny/DiagnosticsExplorer/rsconnect/*
/inst/shiny/DiagnosticsExplorer/rsconnect/*
5 changes: 0 additions & 5 deletions R/DataSplitting.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,6 @@ splitData <- function(plpData = plpData,
populationSize = nrow(trainData$labels)
)

# add pop size to covariateData as used in tidyCovariates
attr(trainData$covariateData, "metaData") <- list(populationSize = nrow(trainData$labels))
class(trainData$covariateData) <- "CovariateData"

testId <- splitId[splitId$index<0,]
testData <- list()
class(testData) <- 'plpData'
Expand All @@ -216,7 +212,6 @@ splitData <- function(plpData = plpData,
data.frame(rowId = testId$rowId),
sizeN = 10000000)
}
class(testData$covariateData) <- "CovariateData"

result <- list(
Train = trainData,
Expand Down

0 comments on commit 2b5f007

Please sign in to comment.