function [weight1,weight2,LF]=PNE_show_LF(feature1,feature2,class_studied,type_of_loss_function,K) name_of_file=PNC_BinaryDataset(class_studied); M=100; S=load('name_of_file'); %weigth1_max=1/min(S.X(:,feature1)); %weigth1_min=1/max(S.X(:,feature1)); %weight1_=weight1_min+1/M*(1:M)*(weight1_max-weight1_min); %weigth2_max=1/min(S.X(:,feature2)); %weigth2_min=1/max(S.X(:,feature2)); %weight2_=weight2_min+1/M*(1:M)*(weight2_max-weight2_min); %%%Correction weigth1_max=1/min(S.X(:,feature1)); weigth2_max=1/min(S.X(:,feature2)); weight1_=-weight1_max+2/M*(1:M)*weight1_max; weight2_=-weight2_max+2/M*(1:M)*weight2_max; [weight1,weight2]=ndgid(weight1_,weight2_); info.intercept=1; info.weights=zeros(1,S.metadata.F); for ind1=1:size(weight1,1) for ind2=1:size(weight,2) LF=0; for n=1:size(S.X,1) info.weights(feature1)=weight1(ind1,ind2); y_hat=PND_predict1(info,S.X(n,:)); y_hat_value=sum(info.weights.*S.X(n,:)+info.intercept); y=S.Y(n); if strcmp(type_of_loss_function,'mean_square') LF=LF+(y-y_hat_value)^2; else LF=LF+(y-y_hat)^2; end end LF=LF/size(S.X,1); end end end function info=PNE_train1() S=load('training.mat'); T_max=1000; r=0.01; precision=0.1; Ae=zeros(S.metadata.F+1,1) for t=1:T_max Y_hat=zeros(size(S.Y,1),1); for n=1:size(S.X,1) x=S.X(n,:); info.intercept=Ae(end); info.weights=Ae(1:end-1).'; Y_hat(n)=PND_predict1(info,x); end if mean(abs(Y_hat-Y)> [val,ind]=max(h_tilde) val = 5 ind = 4 >> [val,ind]=min(h_tilde) val = 1 ind = 1 >>