function [dataset] = applyPreProcess(dataset, currentPreprocessor)

% if we want to log the data, then apply natural log
if strcmp(currentPreprocessor,'log')
    dataset(find(dataset==0)) = 1;  % hinder any infinity conditions
    % setting 0s to 1s will convert infitinities into zeros during log
    dataset(:,1:(size(dataset,2)-1)) = log(dataset(:,1:(size(dataset,2)-1)));
    
elseif strcmp(currentPreprocessor,'freq3bin')
    % or discretize
    dataset = discretize(dataset,3,'freq');
elseif strcmp(currentPreprocessor,'freq5bin')
    % or discretize
    dataset = discretize(dataset,5,'freq');
elseif strcmp(currentPreprocessor,'width3bin')
    % or discretize
    dataset = discretize(dataset,3,'width');
elseif strcmp(currentPreprocessor,'width5bin')
    % or discretize
    dataset = discretize(dataset,5,'width');
elseif strcmp(currentPreprocessor,'norm')
    % or normalize to 0-1 interval
    dataset = myNormalizer(dataset);
elseif strcmp(currentPreprocessor,'PCA')
    % apply pca, i.e. rotate the dimensions of space
    dataset = myPCA(dataset);
elseif strcmp(currentPreprocessor,'SWReg')
    % apply pca, i.e. rotate the dimensions of space
    dataset = mySWReg(dataset);
elseif strcmp(currentPreprocessor,'SFS')
    % apply sfs, i.e. select features by forward selection
    dataset = mySFS(dataset);
else
    % else nothing is selected, so just return
    return;
    
end