svres: Support Vector Regression with Evolutionary Strategy

Description Usage Arguments Details Value Author(s) References Examples

Description

svres is a hybrid algorithm which combines support vector regression and evolutionary strategy (uncorrelated mutation with p step sizes) to build predictive models.

Usage

1
  svres(X.train, Y.train, X.test, PercentValid = 20, Generations = 500, InitialGamma = 0.001, ErrorFunc = MSE, Step = FALSE, StepBoruta = FALSE, SplitRandom = FALSE, Trace = TRUE, dTrace = 10, earlyStop = 50, kfold = 1)

Arguments

X.train

Data matrix (numeric) containing the input values (predictors) used to train the model.

Y.train

Response vector (numeric) used to train the model.

X.test

Data matrix (numeric) containing the input values (predictors) used to test the model.

PercentValid

Percentage of the data reserved for validation. Default is 20%.

Generations

Number of generations considered to train the model. Default is 500 generations.

InitialGamma

Initial gamma hyperparameter. Default is 0.001.

ErrorFunc

Error function to be minimized. The default is the function MSE from package qualV but the function could be customized.

Step

Option whether to use the stepwise regression to prescreening the input variables. Default is FALSE.

StepBoruta

Option whether to use the Boruta selection to prescreening the input variables. Default is FALSE.

SplitRandom

Option whether to split the train set randomly. Default is FALSE.

Trace

If TRUE, information is printed during the running of svres. Default is TRUE.

dTrace

Frequency which the information is pritend during the running of svres. Default is 10.

earlyStop

Stopping criterium for the evolutionary algorithm using the number of consecutive generations without improvements. Default is 50.

kfold

if a integer value k>1 is specified, a k-fold cross validation on the training data is performed.

Details

To achieve better results, the use of a pre-processing technique (e.g. standardization of variables) is important. If there are multiple minima, try different values of InitialGamma.

Value

error.svm

TRUE Hyper-parameter of the best trained model.

forecast

A vector of predicted values generated by the best trained model.

svmf

An object of class "svm" containing the fitted model.

ffTrain

Error value of the training based on ErrorFunc. (It is NULL if kfold > 1)

ffValid

Error value of the validation based on ErrorFunc.

stepvars

Variables selected by the prescreening methods when they are used.

Author(s)

Aranildo R. Lima and Alex J. Cannon

References

Aranildo R. Lima, Alex J. Cannon, William W. Hsieh, Nonlinear regression in environmental sciences by support vector machines combined with evolutionary strategy, Computers & Geosciences, Volume 50, January 2013, Pages 136-144, ISSN 0098-3004, http://www.sciencedirect.com/science/article/pii/S0098300412002269

Cherkassky, V. and Ma, Y., 2004. Practical selection of SVM parameters and noise estimation for SVM regression. Neural Netw. 17, 113-126.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
     ## necessary libraries
     library(qualV)
     library(e1071)
     library(FNN)

      ## generating sets
      x1 <- rnorm(1000)
      x2 <- x1^2
      y  <- x1+x2

      x.fit <- cbind(x1,x2)[1:700,]
      x.test <- cbind(x1,x2)[701:1000,]
      y.fit <- y[1:700]
      y.test <- y[701:1000]

      ## running SVR-ES
      resul <- svres(x.fit, y.fit, x.test)

      ## points are the target and lines are the forecasting
      plot(y.test[1:100])
      lines(resul$forecast[1:100])

ForAI documentation built on May 2, 2019, 6:14 p.m.