Description Usage Arguments Details Value Author(s) References See Also Examples
Training of a generic SLFN using ELM algorithm. First it generates input weights and hidden layer bias ( both randomly choosen ), then calculates the output from the hidden layer ( given a particular activation function as a parameter ) and at the end calculates output weights of the neural network. It returns an ELM model ( an object of class elmNN
) representing the trained neural network.
1 2 3 4 5 |
formula |
a symbolic description of the model to be fitted. |
data |
training data frame containing the variables specified in |
x |
training dataset. |
y |
target output of the training dataset. |
nhid |
number of hidden neurons. Must be >= 1. |
actfun |
type of activation function. Furthermore a list of the implemented activation functions. |
... |
not used. |
Note: since part of ELM algorithm is random ( setting of the input weights and hidden layer bias ), output results of same activation function and same number of hidden neurons may change. To find the most accurate error rate for a fixed setting, it is convenient to make various test on the datasets (i.e. 20 times) using the same settings and calculate the mean error from these tests.
returns the trained neural network, an object of class elmNN
.
nhid |
number of hidden neurons selected |
actfun |
activation function used |
inpweight |
matrix of input weights ( randomly choosen ) |
biashid |
vector of hidden layer bias ( randomly choosen ) |
outweight |
matrix of output weights ( calculated by the algorithm ) |
Alberto Gosso
see elmNN-package
documentation.
elmtrain.formula
,elmtrain.default
,predict.elmNN
,elmNN-package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | set.seed(1234)
##'formula' version
Var1 <- runif(50, 0, 100)
sqrt.data <- data.frame(Var1, Sqrt=sqrt(Var1))
model <- elmtrain(Sqrt~Var1, data=sqrt.data, nhid=10, actfun="sig")
new <- data.frame(Sqrt=0,Var1 = runif(50,0,100))
p <- predict(model,newdata=new)
##Default version
Var2 <- runif(50, 0, 10)
quad.data <- data.frame(Var2, Quad=(Var2)^2)
model <- elmtrain(x=quad.data$Var2, y=quad.data$Quad, nhid=10, actfun="sig")
new <- data.frame(Quad=0,Var2 = runif(50,0,10))
p <- predict(model,newdata=new$Var2)
## The function is currently defined as
function (x, ...)
UseMethod("elmtrain")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.