elm.fast: ELM (fast) neural network.

View source: R/elm.fast.R

elm.fastR Documentation

ELM (fast) neural network.

Description

Fit ELM (fast) neural network. This is an ELM implementation that does not rely on neuralnets package.

Usage

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)
)

Arguments

y

Target variable.

x

Explanatory variables. Each column is a variable.

hd

Starting number of hidden nodes (scalar). Use NULL to automatically specify.

type

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).

reps

Number of networks to train.

comb

Combination operator for forecasts when reps > 1. Can be "median", "mode" (based on KDE estimation) and "mean".

direct

Use direct input-output connections to model strictly linear effects. Can be TRUE or FALSE.

linscale

Scale inputs linearly between -0.8 to 0.8. If output == "logistic" then scaling is between 0 and 1.

output

Type of output layer. It can be "linear" or "logistic". If "logistic" then type must be set to "lasso".

core

If TRUE skips calculation of final fitted values and MSE. Called internally by "elm" function.

ortho

If TRUE then the initial weights between the input and hidden layers are orthogonal (only when number of input variable <= sample size).

Value

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.

Note

This implementation of ELM is more appropriate when the number of inputs is several hundreds. For time series modelling use elm instead.

Author(s)

Nikolaos Kourentzes, nikolaos@kourentzes.com

References

  • 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.

See Also

elm.

Examples


## Not run: 
 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)

## End(Not run)


trnnick/nnfor documentation built on Nov. 12, 2023, 9:45 p.m.