# So, a simple example where we want to scale the dataset "X" into "X_scaled"
# with standard_scaler as scaler_method, we could run
if (FALSE) {
output <- preprocess_scale(input=X, scaler_method="standard_scaler")
X_scaled <- output$output
}
# A simple example where we want to whiten the dataset "X" into "X_whitened"
# with PCA as whitening_method and use 0.01 as regularization parameter, we
# could run
if (FALSE) {
output <- preprocess_scale(input=X, scaler_method="pca_whitening",
epsilon=0.01)
X_scaled <- output$output
}
# You can also retransform the scaled dataset back using"inverse_scaling". An
# example to rescale : "X_scaled" into "X"using the saved model "input_model"
# is:
if (FALSE) {
output <- preprocess_scale(input=X_scaled, inverse_scaling=TRUE,
input_model=saved)
X <- output$output
}
# Another simple example where we want to scale the dataset "X" into
# "X_scaled" with min_max_scaler as scaler method, where scaling range is 1
# to 3 instead of default 0 to 1. We could run
if (FALSE) {
output <- preprocess_scale(input=X, scaler_method="min_max_scaler",
min_value=1, max_value=3)
X_scaled <- output$output
}
Run the code above in your browser using DataLab