MATLAB Codes of ELM Algorithm

(for ELM with kernels)

 

The MATLAB codes ELM with kernels (for both regression and multi-class classification) work linearly similarly to ELM with random hidden nodes. For the sake of convenience, the source codes of ELM with kernels are given separately.

After downloading the source codes of ELM with kernels, save and unzip in your own folder, type “help elm_kernel” for HELP.

 

How to use it?

Basic Usage: elm_kernel(TrainingData_File, TestingData_File, Elm_Type, Regularization_coefficient, Kernel_type, kernel_para)
OR:    [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = elm_kernel(TrainingData_File, TestingData_File, Elm_Type, Regularization_coefficient, Kernel_type, kernel_para)
 


Input:

TrainingData_File

-

Filename of training data set

TestingData_File

-

Filename of testing data set

Elm_Type

-

ELM as functional approximators or classifiers
0 for regression;
1 for (both binary and multi-classes) classification

Regularization_coefficient

-

Regularization coefficient C

Kernel_type

-

Type of kernels:
'RBF_kernel' for RBF Kernel
'lin_kernel' for Linear Kernel
'poly_kernel' for Polynomial Kernel
'wav_kernel' for Wavelet Kernel

kernel_para

-

A number or vector of Kernel Parameters

Output:

 

 

TrainingTime

-

CPU Time (seconds) spent on training ELM

TestingTime

-

CPU Time (seconds) spent on predicting ALL testing data

TrainingAccuracy

-

Training accuracy:
RMSE for regression or correct classification rate for classification

TestingAccuracy

-

Testing accuracy:
RMSE for regression or correct classification rate for classification

MULTI-CLASSE CLASSIFICATION: NUMBER OF OUTPUT NEURONS WILL BE AUTOMATICALLY SET EQUAL TO NUMBER OF CLASSES
FOR EXAMPLE, if there are 7 classes in all, there will have 7 output neurons; neuron 5 has the highest output means input belongs to 5-th class
 
Sample1 regression: [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = elm_kernel('sinc_train', 'sinc_test', 0, 1, ''RBF_kernel',100)
Sample2 classification: elm_kernel('diabetes_train', 'diabetes_test', 1, 1, 'RBF_kernel',100)

 

Data Format of Training and Testing Files

Important Notes:
1)      It is suggested that all the input attributes (except expected targets) be normalized into the range [-1, 1].
2)      The downloaded elm works for single-output function regression and single/multi-label classification cases. Users may easily customize and make it suitable to multi-output function regression cases.

Data Format: Training and testing files are text files, each raw consisting of information of one instance. First column are the expected output (target) for regression and classification applications, the rest columns consist of different attributes information of each instance. For example, the following shows a 7-class application dataset which have 9 input attributes. Since the ELM can automatically detect and propose multi-class labels, users can simply use one column to indicate the multi-class labels in their training and testing data files.

 

% Target
%

Input Attr 1

Input Attr 2

Input Attr 3

Input Attr 4

Input Attr 5

Input Attr 6

Input Attr 7

Input Attr 8

Input Attr 9

 

 

 

 

 

 

 

 

 

 

7

-0.38462

-0.34545

-0.70115

-0.63636

-0.26154

-0.34545

-0.6

-0.59375

-0.28125

3

0.630769

0.545455

0.310345

-0.05785

0.753846

0.545455

0.452632

-0.04688

0.75

2

-0.13846

-0.12727

-0.01149

-0.23967

0.107692

0.018182

-0.03158

-0.15625

0.21875

3

0.353846

0.236364

0.103448

-0.17355

0.476923

0.236364

0.073684

-0.15625

0.34375

2

0.261538

0.054545

-0.14943

-0.42149

0.015385

0.054545

-0.07368

-0.32813

0

4

0.138462

0.054545

0.034483

-0.28926

0.015385

-0.01818

-0.24211

-0.32813

-0.125

4

0.076923

0.090909

-0.28736

-0.38843

0.076923

0.090909

-0.11579

-0.35938

0.0625

1

-0.26154

0.236364

0.195402

-0.05785

-0.26154

0.309091

0.263158

-0.04688

-0.28125

1

-0.13846

0.545455

0.517241

0.07438

-0.13846

0.472727

0.452632

0.078125

-0.03125

7

-0.01538

-0.05455

-0.4023

-0.43802

-0.01538

-0.05455

-0.30526

-0.40625

-0.03125

1

-0.13846

0.527273

0.632184

0.123967

-0.26154

0.6

0.557895

0.125

-0.15625

2

-0.84615

-0.92727

0.632184

0.818182

-0.84615

-0.87273

0.452632

0.734375

-0.875

2

0.107692

0.163636

0.011494

-0.30579

0.107692

0.109091

-0.09474

-0.32813

-0.15625

1

-0.56923

-0.29091

-0.33333

-0.28926

-0.35385

-0.16364

-0.24211

-0.26563

-0.375

4

0.138462

0.163636

0.08046

-0.32231

0.138462

0.090909

0.052632

-0.29688

0.125

% More instances