R/edgenet_modelselection.R
cvedgenet-methods.Rd
Finds the optimal regulariztion parameters using cross-validation for edgenet. We use the BOBYQA algorithm to find the optimial regularization parameters in a cross-validation framework.
cv.edgenet( X, Y, G.X = NULL, G.Y = NULL, lambda = NA_real_, psigx = NA_real_, psigy = NA_real_, thresh = 1e-05, maxit = 1e+05, learning.rate = 0.01, family = gaussian, optim.maxit = 100, optim.thresh = 0.01, nfolds = 10 ) # S4 method for matrix,numeric cv.edgenet( X, Y, G.X = NULL, G.Y = NULL, lambda = NA_real_, psigx = NA_real_, psigy = NA_real_, thresh = 1e-05, maxit = 1e+05, learning.rate = 0.01, family = gaussian, optim.maxit = 100, optim.thresh = 0.01, nfolds = 10 ) # S4 method for matrix,matrix cv.edgenet( X, Y, G.X = NULL, G.Y = NULL, lambda = NA_real_, psigx = NA_real_, psigy = NA_real_, thresh = 1e-05, maxit = 1e+05, learning.rate = 0.01, family = gaussian, optim.maxit = 100, optim.thresh = 0.01, nfolds = 10 )
X | input matrix, of dimension ( |
---|---|
Y | output matrix, of dimension ( |
G.X | non-negativ affinity matrix for |
G.Y | non-negativ affinity matrix for |
lambda |
|
psigx |
|
psigy |
|
thresh |
|
maxit | maximum number of iterations for the optimizer
( |
learning.rate | step size for Adam optimizer ( |
family | family of response, e.g. gaussian or binomial |
optim.maxit | the maximum number of iterations for the optimization
( |
optim.thresh |
|
nfolds | the number of folds to be used - default is 10 |
An object of class cv.edgenet
the estimated, optimal regularization parameters
optimal estimated value for regularization parameter lambda (or, if provided as argument, the value of the parameter)
optimal estimated value for regularization parameter psigx (or, if provided as argument, the value of the parameter)
optimal estimated value for regularization parameter psigy (or, if provided as argument, the value of the parameter)
names of parameters that were estimated
family used for estimated
an edgenet
object fitted with the optimal, estimated
paramters
the call that produced the object
X <- matrix(rnorm(100 * 10), 100, 10) b <- matrix(rnorm(100), 10) G.X <- abs(rWishart(1, 10, diag(10))[, , 1]) G.Y <- abs(rWishart(1, 10, diag(10))[, , 1]) diag(G.X) <- diag(G.Y) <- 0 # estimate the parameters of a Gaussian model Y <- X %*% b + matrix(rnorm(100 * 10), 100) ## dont use affinity matrices and estimate lambda fit <- cv.edgenet( X = X, Y = Y, family = gaussian, maxit = 1, optim.maxit = 1 ) ## only provide one matrix and estimate lambda fit <- cv.edgenet( X = X, Y = Y, G.X = G.X, psigx = 1, family = gaussian, maxit = 1, optim.maxit = 1 ) ## estimate only lambda with two matrices fit <- cv.edgenet( X = X, Y = Y, G.X = G.X, G.Y, psigx = 1, psigy = 1, family = gaussian, maxit = 1, optim.maxit = 1 ) ## estimate only psigx fit <- cv.edgenet( X = X, Y = Y, G.X = G.X, G.Y, lambda = 1, psigy = 1, family = gaussian, maxit = 1, optim.maxit = 1 ) ## estimate all parameters fit <- cv.edgenet( X = X, Y = Y, G.X = G.X, G.Y, family = gaussian, maxit = 1, optim.maxit = 1 ) ## if Y is vectorial, we cannot use an affinity matrix for Y fit <- cv.edgenet( X = X, Y = Y[, 1], G.X = G.X, family = gaussian, maxit = 1, optim.maxit = 1 )