Description Usage Arguments Value
View source: R/utility_funcs.r
This define a function to scale features of a matrix with reference to another matrix useful because you can normalise X_train, and apply the same transformation to X_test. Use with caution if either dataset contain extreme outliers.
1 |
X |
matrix of covariates. |
ref |
matrix of covariates from which to calculate mu and sd. |
na.rm |
a logical to indicate if NAs should be stripped in mean and standard deviation computations. |
add.intercept |
a logical to indicate if column of 1s should be added to the output (Intercept) |
augmented matrix of covariates, standardized and an intercept column
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.