-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BruhatM
committed
Mar 6, 2021
1 parent
4e001c4
commit 8100852
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#' Scaling a dataframe | ||
#' | ||
#' This function scales numerical features based on scaling requirement in a data.frame | ||
#' | ||
#' @param X_train data.frame | ||
#' @param X_Valid data.frame | ||
#' @param X_test data.frame | ||
#' @param scale_features character vector | ||
#' @param scaler_type character | ||
#' | ||
#' @return data.frame of data.frames | ||
#' @export | ||
#' | ||
#' @examples | ||
#' X_train<- data.frame('name' = c('pandaman', 'doorman', 'eve'), 'age' = c(15,20,25), 'networth' = c(100000,100,100000)) | ||
#' X_Valid<- data.frame('name' = c('pandaman_v', 'doorman_v', 'eve_v'), 'age' = c(15,56, 43) , 'networth' = c(123124, 352334,645645) | ||
#' X_test <- data.frame('name' = c('pandaman_t', 'doorman_t', 'eve_t'), 'age' =c(14,15,56), 'networth' = c(123124,90914, 124124) | ||
#' scaled_df <- scaler(X_train, X_Valid, X_test, c('age','networth'), scaler_type='standardscaler') | ||
scaler <- function(X_train, X_Valid, X_test, scale_features, scaler_type){ | ||
} |