Scaling and Centering of an H2OFrame

Share:

Description

Centers and/or scales the columns of an H2O dataset.

Usage

1
2
3
4
h2o.scale(x, center = TRUE, scale = TRUE)

## S3 method for class 'H2OFrame'
scale(x, center = TRUE, scale = TRUE)

Arguments

x

An H2OFrame object.

center

either a logical value or numeric vector of length equal to the number of columns of x.

scale

either a logical value or numeric vector of length equal to the number of columns of x.

Examples

1
2
3
4
5
6
7
8
library(h2o)
h2o.init()
irisPath <- system.file("extdata", "iris_wheader.csv", package="h2o")
iris.hex <- h2o.uploadFile(path = irisPath, destination_frame = "iris.hex")
summary(iris.hex)

# Scale and center all the numeric columns in iris data set
scale(iris.hex[, 1:4])

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.