function [acc, prediction, index] = generateEnsemble_GA( index, actual, hPredictions )
    
    function [ePrediction] = finalHypotesis(prediction)
        class = categories(actual);
        predictedClassCount = countcats(prediction,2);
        [~, I] = max(predictedClassCount,[],2);
        ePrediction = class(I(1:end));
    end

    if (sum(index) == 0)
        acc = 0;
    else
        prediction = finalHypotesis(hPredictions(:, find(index)));
        acc =  -sum(prediction == actual);
    end
end