Fit ELM (fast) neural network. This is an ELM implementation that does not rely on neuralnets package.
elm.fast(
y,
x,
hd = NULL,
type = c("lasso", "ridge", "step", "ls"),
reps = 20,
comb = c("median", "mean", "mode"),
direct = c(FALSE, TRUE),
linscale = c(TRUE, FALSE),
output = c("linear", "logistic"),
core = c("FALSE", "TRUE"),
ortho = c(FALSE, TRUE)
)
An object of class "elm.fast
".
The function plot
produces a plot the network fit.
An object of class "elm.fast"
is a list containing the following elements:
hd
- Number of hidden nodes. This is a vector with a different number for each training repetition.
W.in
- Input weights for each training repetition.
W
- Output layer weights for each repetition.
b
- Output node bias for each training repetition.
W.dct
- Direct connection weights argument if direct == TRUE for each training repetition. Otherwuse NULL.
fitted.all
- Fitted values for each training repetition.
fitted
- Ensemble fitted values.
y
- Target variable.
type
- Estimation used for output layer weights.
comb
- Combination operator used.
direct
- Presence of direct input-output connections.
minmax
- If scaling is used this contains the scaling information for the target variable.
minmax.x
- If scaling is used this contains the scaling information for the input variables.
MSE
- In-sample Mean Squared Error.
Target variable.
Explanatory variables. Each column is a variable.
Starting number of hidden nodes (scalar). Use NULL to automatically specify.
Estimation type for output layer weights. Can be "lasso" (lasso with CV), "ridge" (ridge regression with CV), "step" (stepwise regression with AIC) or "lm" (linear regression).
Number of networks to train.
Combination operator for forecasts when reps > 1. Can be "median", "mode" (based on KDE estimation) and "mean".
Use direct input-output connections to model strictly linear effects. Can be TRUE or FALSE.
Scale inputs linearly between -0.8 to 0.8. If output == "logistic" then scaling is between 0 and 1.
Type of output layer. It can be "linear" or "logistic". If "logistic" then type must be set to "lasso".
If TRUE skips calculation of final fitted values and MSE. Called internally by "elm"
function.
If TRUE then the initial weights between the input and hidden layers are orthogonal (only when number of input variable <= sample size).
Nikolaos Kourentzes, nikolaos@kourentzes.com
For combination operators see: Kourentzes N., Barrow B.K., Crone S.F. (2014) Neural network ensemble operators for time series forecasting. Expert Systems with Applications, 41(9), 4235-4244.
For ELMs see: Huang G.B., Zhou H., Ding X. (2006) Extreme learning machine: theory and applications. Neurocomputing, 70(1), 489-501.
elm
.
# \dontshow{
p <- 2000
n <- 150
X <- matrix(rnorm(p*n),nrow=n)
b <- cbind(rnorm(p))
Y <- X %*% b
fit <- elm.fast(Y,X,reps=1)
print(fit)
# }
if (FALSE) {
p <- 2000
n <- 150
X <- matrix(rnorm(p*n),nrow=n)
b <- cbind(rnorm(p))
Y <- X %*% b
fit <- elm.fast(Y,X)
print(fit)
}
Run the code above in your browser using DataLab