% % example epage 104 % problem epage 128 % % 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; clc; clear; addpath( '../../Code/eda_data' ); addpath('../Chapter1'); % get the iris data without any processing: % [data,vars,classes] = load_iris(0,0,0); y = pdist(data,'euclidean'); z = linkage(y); % <- use the default of single linkage d(S,R) = min_{i \in S,j \in R}(x_i,x_j) figure; dendrogram(z); title( 'single linkage' ); saveas( gcf, '../../WriteUp/Graphics/Chapter5/prob_5_1_iris_den_sl', 'epsc' ); % try with the centroid clustering: % z = linkage(y,'centroid'); figure; dendrogram(z); title( 'centroid linkage' ); saveas( gcf, '../../WriteUp/Graphics/Chapter5/prob_5_1_iris_den_cent', 'epsc' ); % try with the mahalanobis distance: % y = pdist(data,'mahalanobis'); z = linkage(y,'centroid'); figure; dendrogram(z); title( 'centroid linkage (Mahalanobis distance)' ); saveas( gcf, '../../WriteUp/Graphics/Chapter5/prob_5_1_iris_den_cent_mah', 'epsc' ); % try the average distance ... considered by many to be quite good: % y = pdist(data,'euclidean'); z = linkage(y,'average'); figure; dendrogram(z); title( 'dendrogram for the iris dataset: average linkage' ); %saveas( gcf, '../../WriteUp/Graphics/Chapter5/prob_5_1_iris_den_average', 'epsc' );