
Fits various tracks (different random starting values) and chooses best model
Source:R/nn_fit.R
nn_fit.Rd
Fits n_init tracks with different initial values and decides on best model based on information criteria.
Usage
nn_fit(...)
# S3 method for default
nn_fit(
x,
y,
q,
n_init,
inf_crit = "BIC",
lambda = 0,
response = "continuous",
unif = 3,
maxit = 1000,
pkg = "nnet",
...
)
# S3 method for formula
nn_fit(
formula,
data,
q,
n_init,
inf_crit = "BIC",
lambda = 0,
response = "continuous",
unif = 3,
maxit = 1000,
pkg = "nnet",
...
)
Arguments
- ...
additional argument for nnet
- x
Matrix of covariates
- y
Vector of response
- q
Number of hidden nodes
- n_init
Number of random initialisations (tracks)
- inf_crit
Information criterion:
"BIC"
(default),"AIC"
or"AICc"
- lambda
Ridge penalty
- response
Response type:
"continuous"
(default) or"binary"
- unif
Random initial values max value
- maxit
Maximum number of iterations for nnet (default = 100)
- pkg
Package for fitting neural network. One of
nnet
(default) ortorch
- formula
An object of class
"formula"
: a two-sided object with response on the left hand side and the model variables on the right hand side.- data
A data frame containing the variables in the model