% Creating dataset
clear all
load('input/prepared/Fixacni_stabilita_131030_features');
X = [];
Y = priznaky{1}.class';
for r=1:length(priznaky)
   % X = [X log(priznaky{r}.values'];
   X = [X (log(priznaky{r}.values + 0.5))']; % for 'normal' classifiers
end
A = prdataset(X,Y);
A = setprior(A,[0.5 0.5]);
A = remoutl(A);
C0 = ldc([]);

for i = 1:length(A)  
    Atr = A([1:i-1 i+1:end],:);
    Ws = scalem(A,'variance');
    Atr = Atr*Ws;
    Ats = A(i,:);
    Ats = Ats*Ws;
    
    [W,R] = featself(Atr,C0,2,2);
    Atr_selected = Atr*W;
    Ats_selected = Ats*W;
    %Atr_selected = Atr;
    %Ats_selected = Ats;
    C = Atr_selected*C0;
    Z(i)=labeld(Ats_selected*C);
    i
end
Wfinal = featself(A,C0,2,2);
confmat(A.labels, Z')
% prdataset
% scatterdui

