function [data,vars,classes] = load_iris(do_preprocessing, do_column_ordering, do_zscore) % LOAD_IRIS - Loads the iris dataset and applys some preprocessing if desired % % Written by: % -- % John L. Weatherwax 2005-08-14 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- addpath( '../../Code/eda_data' ); load iris data = [setosa; versicolor; virginica]; classes = [ 0*ones(size(setosa,1),1); 1*ones(size(versicolor,1),1); 2*ones(size(virginica,1),1) ]; vars = ['Sepal Length'; 'Sepal Width '; 'Petal Length'; 'Petal Width ']; % n=number of samples=number of patients=72; % p=number of features=number of gene expressions=50 % [n,p] = size(data); if( do_preprocessing ) % this data comes from a natural process ... might be gaussian ... apply the zscore transformation f_mu = mean( data ); f_sd = std( data ); % lets sort the columns in decending order by the magnitude of the variance/standard deviation: if( do_column_ordering ) [f_sd_s,indx] = sort( f_sd ); f_sd_s = fliplr(f_sd_s); indx = fliplr(indx); data = data(:,indx); f_mu = f_mu(indx); f_st = f_sd(indx); end % compute the z-score of this data: if( do_zscore ) data_t = ( data - repmat( f_mu, [n,1] ) ) ./ repmat( f_sd, [n,1] ); data = data_t; end end