From de38adeaa60dd5b187d74d32b6d7c7dea7649cc5 Mon Sep 17 00:00:00 2001 From: BruhatM Date: Sat, 13 Mar 2021 21:24:39 -0800 Subject: [PATCH] scaler fixed --- DESCRIPTION | 4 +++- R/scaler.R | 4 ++++ man/scaler.Rd | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index c489710..b665cf6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,7 +20,9 @@ RoxygenNote: 7.1.1 Imports: dplyr, tidyr, - magrittr + magrittr, + GGally, + caret Suggests: testthat (>= 2.0.0) Config/testthat/edition: 2 diff --git a/R/scaler.R b/R/scaler.R index ddbc105..f29e3a0 100644 --- a/R/scaler.R +++ b/R/scaler.R @@ -11,7 +11,11 @@ #' @export #' #' @examples +#'X_train <- data.frame('a' = c(1,2,3), 'b' = c(5,6,3), 'c' = c(2,1,10)) +#' X_test <- data.frame('a' = c(1,5,3), 'b' = c(5,6,5), 'c' = c(2,5,10)) +#' X_Valid <- data.frame('a' = c(5,5,3), 'b' = c(5,6,5), 'c' = c(2,5,10)) #' scaled_df <- scaler(X_train, X_Valid, X_test, scaler_type='standardization') +#' scaler <- function(X_train, X_valid, X_test, scaler_type){ # checking if scaling methods are valid diff --git a/man/scaler.Rd b/man/scaler.Rd index 3c3b297..228739e 100644 --- a/man/scaler.Rd +++ b/man/scaler.Rd @@ -22,5 +22,9 @@ data.frame of data.frames This function scales numerical features based on scaling requirement(standardization, minmax Scaling) in a data.frame } \examples{ +X_train <- data.frame('a' = c(1,2,3), 'b' = c(5,6,3), 'c' = c(2,1,10)) +X_test <- data.frame('a' = c(1,5,3), 'b' = c(5,6,5), 'c' = c(2,5,10)) +X_Valid <- data.frame('a' = c(5,5,3), 'b' = c(5,6,5), 'c' = c(2,5,10)) scaled_df <- scaler(X_train, X_Valid, X_test, scaler_type='standardization') + }