ã SVM PLOT SCRIPT ã Get solutions for several y & one x (vector from {1;¢1}) (Ker SolSeq P) x : { (F;kp;RangeY)ûP; Xûx,@0 RangeY; âF } ã Get y value for logical string (values after subtraction: 1&¢1) GetY1 {RangeY;str} : { indûstr/ÉÒstr; ind0û(ind=0)/ind; ind1û(ind=¢2+Òstr)/ind; strûstr^1÷str; indû1+str/ÉÒstr; RangeY[ind0,ind,ind1] } ã Get y value for logical string (values after subtraction: 2&¢2) GetY2 {RangeY;str} : { indûstr/ÉÒstr; (RangeY[ind]+RangeY[ind+1])ß2 } ã Main function to get solution y=[y1,y2,..,yn] for each x=[x1,x2,...,xn] ã Ker is a kernel function's name ã F is a classification rule as a character string (ex. '«(coef+.«Ker{sv;ôX;kp})-rho') ã S is a data matrix (row vectors) ã kp is kernel parameter ã NOTE!!! All parameters of F (except kp&X) must be defined by user before ã Output: matrises of x and y (row vectors) for decision surface (changing label from 1 to ¢1 and from ¢1 to 1) (Ker Solution F) R : { (S;kp)ûR; stepXû100; stepYû100; (RangeX;RangeY)û(<@0 Ä/S)+¡((<ÉstepX+1),<ÉstepY+1)«¡<@0((Ó/S)-Ä/S)ßstepX,stepY; solûô>(Ker SolSeq (F;kp;RangeY))¡RangeX; logû(¢1Õsol-1÷sol),0; xfû(~^/log=0)/RangeX; logû(~^/log=0)/ôlog; mascû©/@1¡1 2 ¢1 ¢2=¡masc); numû1 2 ¢1 ¢2; logmatû(<@0 num)=¡masc/¡