function [] = reduce(features_o, normalization, toprint)

clusttypes = {'orig','gauss','kmeans','hierarch'};
reductypes = {'PCA', 'tSNE', 'LLE', 'LEM'};

%% analysis
disp(['Analyse...']);

features = som_normalize(features_o, normalization);


for red = 1:4
    disp( ['  red. ' num2str(red)] );
    feat_reduced{red} = mreduce(reductypes{red}, features);
end;

%% clustering
disp(['Cluster...']);

sp=1;

for red = 1:4
    [sig_sep{red}, sig_aux{red}] = clust(clusttypes{sp}, feat_reduced{red}, 2);
end;


%% draw
disp(['Draw...']);

figure('PaperPosition', [0 0 14.5 10.0], 'PaperUnits','centimeters','PaperSize',[14.5 10.0]);
clf;
set(gcf, 'Name', 'Reduction');
font_size = 8;
line_width = 1.5;

axv=[];

for red=1:4
%    subplot('Position',[(sp-1)/spn+0.05 0.15 0.75/spn 0.7]);
    subplot(2,2,red);
%    axv(sp)=axis;
    cdraw(clusttypes{sp}, feat_reduced{red}, sig_sep{red}, sig_aux{red});
    
    set(gca,'XMinorGrid','off','YMinorGrid','off','FontSize',font_size);
    ylabel('Component 2','FontSize',font_size+2);
    xlabel('Component 1','FontSize',font_size+2);
    title(reductypes{red});
    
end;

drawnow;

%% dist
disp(['Distances...']);
disp(' ');
for red=1:4;
    
    plselA = feat_reduced{red} ( sig_sep{red}(1:size(feat_reduced{red},1)) ==1, :);
    plselB = feat_reduced{red} ( sig_sep{red}(1:size(feat_reduced{red},1)) ==2, :);
    
    dist = zeros(size(plselA,1), size(plselB,1));
    
    for A=1:size(plselA)
        for B=1:size(plselB)
            
            da = plselA(A,1) - plselB(B,1);
            db = plselA(A,2) - plselB(B,2);
            dist(A,B) = sqrt (da^2 + db^2);

        end;
    end;

    dmin = min(min(dist));
    dmax = max(max(dist));
    
    disp( [reductypes{red} ':  ' num2str(dmin/dmax,2)]);
    
end;

disp(' ');
   
%% print

if (toprint)
    print('-dpdf','print/reduc_ukaz.pdf');
% 
%     linkaxes(axv);
% 
%     font_size = 8;
%     line_width = 1.5;
%     figure('Units','inches','Position',[2, 1, 3.2, 2.6],'PaperType','A4','PaperUnits','inches','PaperPosition',[1, 1, 3.2, 2.6])
% 
%     cdraw(clusttypes{sp}, feat_reduced_s, sig_sep{sp}, sig_aux{sp});
% 
%     grid on
%     set(gca,'YLim',[-1.1 1.1],'XMinorGrid','off','YMinorGrid','off','FontSize',font_size);
%     ylabel('Component 2','FontSize',font_size+2);
%     xlabel('Component 1','FontSize',font_size+2);
%     drawnow;
% 
%     print('-dpdf','kuk.pdf');

end;

end




