| os.sort | R Documentation |
Sort and select predictors according to the strength of target-predictor relationship
os.sort(x, y, method = "linear", n.pred = ncol(x), thresh = 1)
x |
A data matrix (raw: samples, col: predictors). |
y |
A vector of target value. |
method |
A string to specify the regression function for calculating R-squared values. "linear" (default), "quadratic" or "cubic" function can be specified. |
n.pred |
The number of predictors to be leaved in prediction model (default: ncol(x)). |
thresh |
The lower threshold of R-squared value to be leaved in prediction model (default: 1). |
A data matrix (raw: samples, col: sorted predictors)
Takahiko Koizumi
data(Pinus)
train <- os.clean(Pinus$train)
target <- Pinus$target
cor(target, train[, 1])
train <- os.sort(train, target, thresh = 0.5)
cor(target, train[, 1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.