The is the supplementary example for the SemiSVR.

Files :
There are two matlab-based programming files:
Polynomial_Userkernel.m: the polynomial kernel function;
SemiSVR_PolyKernel_LP.m: the SemiSVR model.

There is a matlab-based data file: PDZdomain_118AAs_semiSVR_model.mat. 
In this file, there is a final model trained from all the mouse PDZ domain-peptide data, that is from 560 positive pairs and 1167 negative pairs.
The numerical-encoded amino acid sequence based dataset are also included in this file.

C1=2^4; C2=4;
eps = 0.0625;  
p1=1;p2=2;
gap=25; %% This the corresponding numerical encoding for the gap in sequence by using matlab funciton: aa2int.m .
KMneg = Polynomial_Userkernel(Xneg_118AAs(:,1:118),Xpos_118AAs(:,1:118),gap,p1,p2).*Polynomial_Userkernel(Xneg_118AAs(:,119:end),Xpos_118AAs(:,119:end),gap,p1,p2);
KMpos = Polynomial_Userkernel(Xpos_118AAs(:,1:118),Xpos_118AAs(:,1:118),gap,p1,p2).*Polynomial_Userkernel(Xpos_118AAs(:,119:end),Xpos_118AAs(:119:end),gap,p1,p2);


Ypos=Scale(log10(YKd),-1,1); %% Scale the transformed Kd values into [-1,1].
threshold = Scale(log10(100),-1,1,min(log10(YKd)),max(log10(YKd)));

[alpha,b,Yneg,kesi,kesi_bar]=SemiSVR_PolyKernel_LP(KMpos,KMneg,Ypos,threshold,C1,C2,eps); %% Learn out the final model.

For some new coming testing data set Xtest, SemiSVR predict them as follows:

KMtest = Polynomial_Userkernel(Xtest(:,1:118),Xpos_118AAs(:,1:118),gap,p1,p2).*Polynomial_Userkernel(Xtest(:,119:end),Xpos_118AAs(:119:end),gap,p1,p2);

Regression function: f(Xtest) = KMtest*alpha-b;

 