64
64
### 01. Classification using RVM (RVC)
65
65
66
66
A demo for classification using RVM
67
- ```
67
+ ``` MATLAB
68
68
clc
69
69
clear all
70
70
close all
@@ -97,7 +97,7 @@ rvm.draw(results)
97
97
```
98
98
99
99
results:
100
- ```
100
+ ``` MATLAB
101
101
*** RVM model (classification) train finished ***
102
102
running time = 0.1604 seconds
103
103
iterations = 20
@@ -122,7 +122,7 @@ accuracy = 96.6667%
122
122
### 02. Regression using RVM (RVR)
123
123
124
124
A demo for regression using RVM
125
- ```
125
+ ``` MATLAB
126
126
clc
127
127
clear all
128
128
close all
@@ -150,7 +150,7 @@ results = rvm.test(testData, testLabel);
150
150
rvm.draw(results)
151
151
```
152
152
results:
153
- ```
153
+ ``` MATLAB
154
154
*** RVM model (regression) train finished ***
155
155
running time = 0.1757 seconds
156
156
iterations = 76
@@ -178,7 +178,7 @@ MAE = 0.1106
178
178
### 03. Kernel funcions
179
179
180
180
A class named *** Kernel*** is defined to compute kernel function matrix.
181
- ```
181
+ ``` MATLAB
182
182
%{
183
183
type -
184
184
@@ -200,7 +200,7 @@ kernel = Kernel('type', 'sigmoid', 'gamma', value);
200
200
kernel = Kernel('type', 'laplacian', 'gamma', value);
201
201
```
202
202
For example, compute the kernel matrix between ** X** and ** Y**
203
- ```
203
+ ``` MATLAB
204
204
X = rand(5, 2);
205
205
Y = rand(3, 2);
206
206
kernel = Kernel('type', 'gaussian', 'gamma', 2);
@@ -219,7 +219,7 @@ kernelMatrix =
219
219
### 04. Hybrid kernel
220
220
221
221
A demo for regression using RVM with hybrid_kernel (K =w1×K1+w2×K2+...+wn×Kn)
222
- ```
222
+ ``` MATLAB
223
223
clc
224
224
clear all
225
225
close all
@@ -253,7 +253,7 @@ rvm.draw(results)
253
253
254
254
A demo for RVM model with Parameter Optimization
255
255
256
- ```
256
+ ``` MATLAB
257
257
clc
258
258
clear all
259
259
close all
@@ -293,7 +293,7 @@ rvm.draw(results)
293
293
```
294
294
295
295
results:
296
- ```
296
+ ``` MATLAB
297
297
*** RVM model (classification) train finished ***
298
298
running time = 13.3356 seconds
299
299
iterations = 88
@@ -324,7 +324,7 @@ accuracy = 97.1429%
324
324
325
325
A demo for RVM model with Parameter Optimization
326
326
327
- ```
327
+ ``` MATLAB
328
328
%{
329
329
A demo for hybrid-kernel RVM model with Parameter Optimization
330
330
%}
@@ -366,7 +366,7 @@ rvm.draw(results)
366
366
```
367
367
368
368
results:
369
- ```
369
+ ``` MATLAB
370
370
*** RVM model (regression) train finished ***
371
371
running time = 24.4042 seconds
372
372
iterations = 377
@@ -402,22 +402,22 @@ MAE = 0.4867
402
402
403
403
In this code, two cross-validation methods are supported: 'K-Folds' and 'Holdout'.
404
404
For example, the cross-validation of 5-Folds is
405
- ```
405
+ ``` MATLAB
406
406
parameter = struct( 'display', 'on',...
407
407
'type', 'RVC',...
408
408
'kernelFunc', kernel,...
409
409
'KFold', 5);
410
410
```
411
411
For example, the cross-validation of the Holdout method with a ratio of 0.3 is
412
- ```
412
+ ``` MATLAB
413
413
parameter = struct( 'display', 'on',...
414
414
'type', 'RVC',...
415
415
'kernelFunc', kernel,...
416
416
'HoldOut', 0.3);
417
417
```
418
418
419
419
### 08. Other option
420
- ```
420
+ ``` MATLAB
421
421
%% custom optimization option
422
422
%{
423
423
opt.method = 'bayes'; % bayes, ga, pso
0 commit comments