Description Usage Arguments Details Value References Examples
Constructs a SLFN, an artificial neural network with a single input and output layer, and no hidden layer.
1 2 3 |
formula |
an object of class |
parameters |
a named list with (starting) values for the parameters. See details. |
type |
the name of the activation function. Currently, only linear and logistic activation functions are implemented. See Example on how to use other activation functions. |
data |
(optional) data frame. |
subset |
(optional) subset. |
fixed |
(optional) logical vector indicating whether parameters are fixed (TRUE) or freely estimable (FALSE). |
parStruct |
(optional) ParStruct object. Note that if parStruct is given, the ‘fixed’ argument above will be ignored. |
window.size |
an integer >= 0 specifying the number of previous data points used to compute the gradient (in addition to the current data point). |
remove.intercept |
should an intercept be included in the predictors? If set to TRUE, an intercept term (if present) will be removed from x. This can be useful when the predictors are categorical variables, where removing the intercept in the formula will result in an extra dummy variable. |
base |
if the criterion (rhs of formula) is a factor, an overparametrized dummy coding will be used by default. That is, for a criterion with n levels, a dummy matrix will be used with n columns. By setting base to an integer k, 1 <= k <= n, column k will be removed from the matrix. |
ntimes |
an optional vector with, for each repetition in the data, the total number of trials. |
replicate |
are the repeated series true replications, i.e., are the model parameters considered identical for each series? |
The SLFN
function sets up a simple ANN useful for deriving
online model predictions etc.
A (fitted) object of class SLFN
extending LearningModel
Bishop, C.M. (1995). Neural Networks for Pattern Recognition. Oxford, UK: Oxford University Press.
Gluck, M. A., & Bower, G. H. (1988). From conditioning to category learning: An adaptive network model. Journal of Experimental Psychology: General, 117, 227–247.
1 2 3 4 5 6 7 8 9 10 11 | ## open weather prediction data
data(WPT)
## initialize model
mod <- SLFN(y~x1+x2+x3+x4,type="logistic",data=WPT,ntimes=rep(200,25),parameters=list(eta=.1,alpha=.001),fix=list(beta=TRUE,ws=TRUE),remove.intercept=TRUE)
## estimate free parameters
## Not run: mod <- fit(mod)
summary(mod)
## TODO: add other activation function
##
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.