function best_meta = select_tt(X, y, fn_train, fn_loss, fn_predict, metaparams)
% Funckija za izbor najboljeg metaparametra podelom podataka na trening i test skup

    num_metaparams = length(metaparams);
    errors = zeros(num_metaparams,1);
    
    for i = 1:num_metaparams
        errors(i) = eval_tt(X, y, @(X, y) fn_train(X, y, metaparams(i)), fn_loss, fn_predict);
    end
    
    [~, best_ind] = min(errors);
    best_meta = metaparams(best_ind);

end
