View source: R/predict.xplus.R
| predict.xplus | R Documentation |
Predict from an xplus model
## S3 method for class 'xplus'
predict(object, newx = NULL, s = "lambda.min", type = "response", ...)
object |
An |
newx |
Optional finite numeric feature matrix; defaults to training data. Named training features must match and are reordered automatically. |
s |
Exact penalty name ( |
type |
Prediction type: |
... |
Additional arguments are not supported and cause an error. |
Probabilities (type = "response") or log-odds (type = "link"); cached probabilities of 0 and 1 give infinite log-odds.
Classes use a factor with fixed levels "0", "1" for one lambda, or a dimension-preserving 0/1 matrix for multiple lambdas.
Zhou et al. (2022). doi:10.1371/journal.pcbi.1009956
xplus(), print.xplus()
set.seed(1)
x <- matrix(rnorm(100 * 5), ncol = 5)
y <- c(rep(1, 20), rep(0, 80))
fit <- xplus(x, y, max_iter = 5)
predict(fit, newx = x, type = "response")
predict(fit, newx = x, type = "link")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.