Description Usage Arguments Value References Examples
Finds the number of hidden neurons using the hill climbing procedure.
1 2 3 | Elm.search.hc(X.fit, Y.fit, n.ensem= 10, n.blocks=5, ErrorFunc=RMSE, PercentValid=20,
maxHiddenNodes = NULL, Trace=TRUE, autorangeweight=FALSE, rangeweight=1,
activation='TANH',outputBias = FALSE,rangebias = 1)
|
X.fit |
Data matrix (numeric) containing the input values (predictors) used to train the model. |
Y.fit |
Response vector (numeric) used to train the model. |
n.ensem |
Number of ensemble members. Default is |
n.blocks |
an integer specifying the desired number of cross-validation folds. Default is |
ErrorFunc |
Error function to be minimized. The default is the function |
PercentValid |
Percentage of the data reserved for validation (if |
maxHiddenNodes |
Maximum number of hidden nodes. Default is |
Trace |
If |
autorangeweight |
Option whether to use the automated range used for the weights. Default is |
rangeweight |
Initial random weights on |
activation |
Activation function of the hidden layer neurons. Available functions are: 'TANH' (default) and 'SIG'. |
outputBias |
Option whether to use the bias parameter in the output layer |
rangebias |
Initial random bias on |
The best number of hidden neurons found by the automatic procedure.
Lima, A.R., A.J. Cannon and W.W. Hsieh. Nonlinear regression in environmental sciences using extreme learning machines. Environmental Modelling and Software (submitted 2014/2/3)
Yuret, D., 1994. From genetic algorithms to efficient optimization. Technical Report 1569. MIT AI Laboratory.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | set.seed(123)
attach(wtloss)
library("scales")
#scaling the inputs/outputs
x.train <- rescale(as.matrix(wtloss$Days), to=c(-1,1))
y.train <- rescale(as.matrix(wtloss$Weight), to=c(-1,1))
#Finding the best number of hidden neurons
number.hn <- Elm.search.hc(x.train,y.train)
#training the ELM
trained.elm <- Elm.train(x.train,y.train,Number.hn = number.hn)
#rescaling back the elm outputs
elm.fit.values <- rescale(trained.elm$predictionTrain,to= range(as.matrix(wtloss$Weight)),from=c(-1,1))
oldpar <- par(mar = c(5.1, 4.1, 4.1, 4.1))
plot(wtloss$Days, wtloss$Weight, type = "p", ylab = "Weight (kg)",main="Weight Reduction")
lines(wtloss$Days, elm.fit.values,col=2,type='b')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.