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

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

normalize = true;

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

feat_data   = NUM(51:end, 30:70);
clin_data   = NUM(51:end,5);

%% Perform the normalization (mean = 0, std = 1)
data = feat_data;

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

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

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

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