clear

%% load network
% loaded_net=load("NLD_network_polar_01_log_mvm_c1_05.mat");
loaded_net=load("NLD_network_minmax_c1_05.mat");
% loaded_net=load("NLD_network_polar_01_c1_05.mat");
% loaded_net=load("NLD_network_polar_01_mvm_c1_05.mat");
% loaded_net=load("NLD_network_polar_01_log_c1_05.mat");

net=loaded_net.net;
clear("loaded_net"); % eliminate useless data from workspace


%% load and test NLD

% loaded_testdata=load("NLD_4testing_polar_01_log_mvm_sparsi.mat");
loaded_testdata=load("NLD_4testing_minmax_sparsi.mat");
% loaded_testdata=load("NLD_4testing_polar_01_sparsi.mat");
% loaded_testdata=load("NLD_4testing_polar_01_mvm_sparsi.mat");
% loaded_testdata=load("NLD_4testing_polar_01_log_sparsi.mat");
rho=loaded_testdata.rho;
c3=loaded_testdata.c3;
c1=loaded_testdata.c1;
c3cr=loaded_testdata.c3cr;
c1cr=loaded_testdata.c1cr;
clear("loaded_testdata"); % eliminate useless data from workspace

pred = classify(net, rho);
pred_num = str2double(cellstr(pred));

count1=0;
count2=0;
count3=0;
c11=[];
c31=[];
c12=[];
c32=[];
c13=[];
c33=[];
for i=1:length(c1)
    switch pred_num(i)
        case 1
            count1=count1+1;
            c11(count1)=c1(i);
            c31(count1)=c3(i);
        case 2
            count2=count2+1;
            c12(count2)=c1(i);
            c32(count2)=c3(i);
        case 3
            count3=count3+1;
            c13(count3)=c1(i);
            c33(count3)=c3(i);
    end
end

figure;plot(c11,c31,'g.');hold on;
plot(c12,c32,'r.');plot(c13,c33,'k.');
plot(c1cr,c3cr,'k--','LineWidth',3);axis tight


