matrix.standardize {adelie} | R Documentation |
Creates a standardized matrix.
Description
Creates a standardized matrix.
Usage
matrix.standardize(
mat,
centers = NULL,
scales = NULL,
weights = NULL,
ddof = 0,
n_threads = 1
)
Arguments
mat |
An |
centers |
The center values. Default is to use the column means. |
scales |
The scale values. Default is to use the sample standard deviations. |
weights |
Observation weight vector, which defaults to 1/n per observation. |
ddof |
Degrees of freedom for standard deviations, with default 0 (1/n). The alternative is 1 leading to 1/(n-1). |
n_threads |
Number of threads. |
Value
Standardized matrix.
The object is an S4 class with methods for efficient computation by adelie.
Conventions depend on the matrix class. For example, if a matrix is constructed using matrix.onehot()
, only the quantitative variables are standardized.
Author(s)
James Yang, Trevor Hastie, and Balasubramanian Narasimhan
Maintainer: Trevor Hastie hastie@stanford.edu
Examples
n <- 100
p <- 20
X <- matrix(rnorm(n * p), n, p)
out <- matrix.standardize(matrix.dense(X))
[Package adelie version 1.0.8 Index]