add_dummies {TRexSelector} | R Documentation |
Add dummy predictors to the original predictor matrix
Description
Sample num_dummies dummy predictors from the univariate standard normal distribution and append them to the predictor matrix X.
Usage
add_dummies(X, num_dummies)
Arguments
X |
Real valued predictor matrix. |
num_dummies |
Number of dummies that are appended to the predictor matrix. |
Value
Enlarged predictor matrix.
Examples
set.seed(123)
n <- 50
p <- 100
X <- matrix(stats::rnorm(n * p), nrow = n, ncol = p)
add_dummies(X = X, num_dummies = p)
[Package TRexSelector version 1.0.0 Index]