predict.fracridge | R Documentation |
Generates predictions from a fracridge
model.
## S3 method for class 'fracridge'
predict(object, newdata, fracs = object$fracs, ...)
object |
An object of class |
newdata |
A numeric matrix of new data with the same number of columns as the training data. |
fracs |
A numeric vector specifying which fractions to use for prediction.
Must be a subset of the fractions used in the training. Default is |
... |
Additional arguments (currently ignored). |
A numeric matrix of predictions with rows corresponding to observations in newdata
and columns corresponding to the specified fractions and targets.
## Not run:
# Generate random data
set.seed(0)
X <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10)
y <- rnorm(100)
# Perform fractional ridge regression
result <- fracridge(X, y, fracs = 0.3)
# Generate new data
X_new <- matrix(rnorm(20 * 10), nrow = 20, ncol = 10)
# Make predictions
preds <- predict(result, X_new)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.