Description Usage Arguments Details Value Note Author(s) References See Also Examples
Expands the basis according to the order
argument, then runs relaxnet in order to select a subset of the basis functions. Multiple values of order
and alpha
(the elastic net tuning parameter) may be specified, leading to selection of a specific value by cross-validation.
1 2 3 4 5 6 7 8 9 10 11 |
x |
Input matrix, each row is an observation vector. Sparse matrices are not yet supported for the |
y |
Response variable. Quantitative for |
family |
Response type (see above). |
order |
The order of basis expansion. Elements must be in the set |
alpha |
The elastic net mixing parameter, see |
nfolds |
Number of folds - default is 10. Although |
foldid |
An optional vector of values between 1 and |
screen.method |
The method to use to screen variables before basis expansion is applied. Default is no screening. |
screen.num.vars |
The number of variables (columns of |
multicore |
Should execution be parallelized over cv folds (for |
mc.cores |
Number of cores/cpus to be used for multicore processing. Parallelization is over cross-validation folds. |
mc.seed |
Integer value with which to seed the RNG when using parallel processing (internally, |
... |
Further arguments passed to |
The type.measure
argument has not yet been implemented. For type = gaussian models, mean squared error is used, and for type = binomial, binomial deviance is used.
Returns and object of class "widenet"
with the following elements:
call |
A copy of the call which generated this object |
order |
The value of the |
alpha |
The value of the |
screen.method |
The value of the |
screened.in.index |
A vector which indexes the columns of |
colsBinary |
A vector of length |
cv.relaxnet.results |
A list of lists containing |
min.cvm.mat |
A matrix containing the minimum cross-validated risk for each combination of values of alpha and order |
which.order.min |
The order which "won" the cross-validation, i.e. resulted in minimum cross-validated risk. |
which.alpha.min |
The alpha value which "won" the cross-validation. |
total.time |
Total time in seconds to produce this result. |
This is a preliminary release and several additional features are planned for later versions.
Stephan Ritter, with design contributions from Alan Hubbard.
Much of the code (and some help file content) is adapted from the glmnet package, whose authors are Jerome Friedman, Trevor Hastie and Rob Tibshirani.
Stephan Ritter and Alan Hubbard, Tech report (forthcoming).
predict.widenet
, relaxnet
, cv.relaxnet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | n <- 300
p <- 5
set.seed(23)
x <- matrix(rnorm(n*p), n, p)
colnames(x) <- paste("x", 1:ncol(x), sep = "")
y <- x[, 1] + x[, 2] + x[, 3] * x[, 4] + x[, 5]^2 + rnorm(n)
widenet.result <- widenet(x, y, family = "gaussian",
order = 2, alpha = 0.5)
summary(widenet.result)
coefs <- drop(predict(widenet.result, type = "coef"))
coefs[coefs != 0]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.