|
1 |
| -def RKHS(Input,Y,Xtest=None,yTest=None, |
2 |
| - opType='Classification',classifier='SVM',kernel='linear', |
3 |
| - degree=3,gamm=1,C=1,learning_rate=None,tol=1e-2,epochs=400, |
4 |
| - traceObj=False,gradCheck=False,optMode='Newton'): |
| 1 | +#gateway function for the solver |
| 2 | +#output model parameters + prediction |
| 3 | + |
| 4 | +def RKHS(Input,Y,Xtest=None,yTest=None, #input data |
| 5 | + opType='Classification', #classification or regression |
| 6 | + classifier='SVM', #classifier name 'SVM', 'LS', 'Softmax' |
| 7 | + kernel='linear', #kernel type: 'linear', 'gaussian', 'polynomial' |
| 8 | + degree=3, #polynom degree |
| 9 | + gamm=1, #RBF parameter |
| 10 | + C=1, #cost parameter: lambda=1/(2*C) |
| 11 | + learning_rate=None, |
| 12 | + tol=1e-2, |
| 13 | + epochs=400, #number of iterations |
| 14 | + traceObj=False, |
| 15 | + gradCheck=False, |
| 16 | + optMode='NGD' #optimization method 'NGD', 'CGD' |
| 17 | + ): |
5 | 18 | import numpy as np
|
6 | 19 | rsp=transformResponse(Y,classifier,opType)
|
7 | 20 | resp=rsp['respMat']
|
|
0 commit comments