[Home]

##### SLLSVR

A Matlab code for Robust \$L_p\$-norm least squares support vector regression with feature selection. (You could Right-Click [Code] , and Save, then you can download the whole matlab code.)

##### Reference

Chun-Na Li, Yuan-Hai Shao, Da Zhao, Yan-Ru Guo, Xiang-Yu Hua "Robust L_p-norm least squares support vector regression with feature selection", Submitted 2020.

##### Main Function

function [Predict_Y,w,b]=SLSSVR(TestX,X,Y,feacriepsilon,p,rho,gamma) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Ref: SLSSVR % [Predict_Y,w,b] = SLSSVR(TestX,X,Y,feacriepsilon,p,rho,gamma) % Input: % TestX - Test Data matrix. Each row vector of fea is a data point. % X - Training input of Data matrix. % Y - Training output of Data vector. % p - p in Lp-norm, (0,1] % rho - rho in SLLSVR, (0,inf) % gamma - gamma in SLLSVR, (0,inf) % feacriepsilon - the criterion of some feature being regarded as 0, or % being selected. % Output: % Predict_Y - Predict value of the TestX. % w - weight vector. % b - bias. % % Reference: % Chun-Na Li, Yuan-Hai Shao, Da Zhao, Yan-Ru Guo, Xiang-Yu Hua, % "Robust \$L_p\$-norm least squares support vector regression with feature % selection", Submitted 2020 % % Version 2.0 --Aus/2020 % Written by Yuan-Hai Shao (shaoyuanhai21@163.com) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Initialization [~,n]=size(X); s=round(n*0.9); % The estimated sparsity epsilon1=1; eta=0.1; u=ones(n+1,1); itNum=5; t=0; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % training aa=p*rho; [e,~]=size(Y(:,1)); e=ones(e,1); I=diag(ones(n,1)); H=[(X'*X+1/gamma*I),X'*e; e'*X,e'*e]; clear I; d=[X e]'*Y; b=H'*d; H=H'*H; u1=H\d; while(t<=itNum) && abs(norm(u1)-norm(u))>=10^-9 cc=epsilon1+u1.^2; bb=cc.^(1-p/2); A=diag(aa./bb); A=sparse(A); H=A+H; H=(H+H')/2; u=u1; H=sparse(H); u1=H\b; sortu1=sort(abs(u1),2,'descend'); ru1=sortu1(s+1); epsilon1=min(epsilon1,eta*ru1); t=t+1; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % output and predict w=u1(1:n); for i=1:n if abs(w(i))