% % an extension of Example 8.1 % % 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. % %----- close all; drawnow; rehash; clc; clear; addpath( '../../Code/eda_data' ); addpath( '../../Code/eda_toolbox' ); addpath( '../Chapter1' ); % First load the data. [leukemia,true_labs] = load_leukemia(0,0,0); [n,p] = size(leukemia); x = zeros(n,p); % Standardize each row (gene) to be mean % zero and standard deviation 1. for i = 1:n sig = std(leukemia(i,:)); mu = mean(leukemia(i,:)); x(i,:) = (leukemia(i,:) - mu)/sig; end % Do hierarchical clustering. Y = pdist(x); Z = linkage(Y,'complete'); [H, T] = dendrogram(Z,15); title('Leukemia Data') reclus(T); title( 'ReClus: Leukemia Data: No class labels' ); saveas( gcf, '../../WriteUp/Graphics/Chapter8/prob_8_3_rc_nl', 'epsc' ); reclus(T,true_labs); title( 'ReClus: Leukemia Data: With class labels' ); saveas( gcf, '../../WriteUp/Graphics/Chapter8/prob_8_3_rc_wl', 'epsc' );