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,'discretize3bins') % or discretize dataset = discretize(dataset,3); elseif strcmp(currentPreprocessor,'discretize5bins') % or discretize dataset = discretize(dataset,5); elseif strcmp(currentPreprocessor,'normalize') % 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); elseif strcmp(currentPreprocessor,'SBS') % apply pca, i.e. select features by backward selection dataset = mySBS(dataset); else % else nothing is selected, so just return return; end