scaleXPred: Scale a matrix to the same scale as the scaled training data...

Description Usage Arguments Details Value Author(s) Examples

View source: R/rescale.R

Description

Scales a matrix to the same scale as the scaled training data matrix

Usage

1

Arguments

newdata

An n x d matrix

x

An n x d matrix that has already been scaled to [0, 1]^d. This matrix needs to have attributes "scaled:minimum" and "scaled:range"

Details

This function scales a matrix to the same scale as the scaled training data matrix by subtracting off the minimum value of the training data in each column from each value and dividing by the range of the training data in that column.

Value

A matrix rescaled to

[0, 1]^d

with attributes "scaled:minimum" and "scaled:range"

Author(s)

Casey Davis (cbdavis33@gmail.com)

Examples

1
2
scaleXPred(matrix(runif(20, 0, 10), nrow = 50, ncol = 2),
           scaleX(matrix(runif(20, 0, 5), nrow = 10, ncol = 2)))

cbdavis33/bcgp documentation built on Oct. 1, 2019, 8:07 a.m.