%% Initial cleanup
clear all;
close all;
clc;

%% Paths and variables
addpath(genpath(pwd));

normalize = true;

%% Load the *.mat file
[NUM,~,~] = xlsread('hodnoty_parametru');

data = NUM(:, 30:70);
labs = NUM(:,1);
%% Perform the normalization (mean = 0, std = 1)
% data = feat_matrix;

if (normalize)
    for dat = 1:size(data, 2)   
        data_val = data(:, dat);
        mean_val = mean(data_val);
        std_val  = std(data_val);

        data(:, dat) = (data_val - mean_val)/std_val;
    end
end

%% Check the format of labels
% labs = zeros(size(labels, 1), 1);
% 
% for i = 1:length(labels)
%     if (strcmp(labels{i, 1}, 'HC'))
%         
%         % Healthy = 0
%         labs(i, 1) = 0;
%     else
%         
%         % Disordered = 1
%         labs(i, 1) = 1;
%     end
% end

%% Set the optional arguments
sett = struct();

sett.num_cross_validations = 20;
sett.k_fold = 10;
sett.classifier = struct();
sett.classifier.alg = 'tree';
sett.t = 2;
sett.N = 100;
sett.score = 'acc';


%% Perform feature selection based on classification
[out, var] = SFFS_cls(data, labs, sett);