% % example epage ???104 % problem epage 129 % % 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'); addpath( '../../Code/eda_toolbox' ); % this cluster assignment will have a rand index of 0.0 ... totally dismatched clusters: c_1 = [ 1; 1; 1; 1; 1 ]; c_2 = [ 1; 2; 3; 4; 5 ]; fprintf('adjrand( c_1, c_2 ) = %d\n', adjrand( c_1, c_2 ) ); fprintf('randind( c_1, c_2 ) = %d\n', randind( c_1, c_2 ) ); % this cluster assignement will have a rand index of 1.0 ... perfect matching clusters c_1 = [ 1; 1; 1; 2; 2 ]; c_2 = [ 2; 2; 2; 1; 1 ]; fprintf('adjrand( c_1, c_2 ) = %d\n', adjrand( c_1, c_2 ) ); fprintf('randind( c_1, c_2 ) = %d\n', randind( c_1, c_2 ) ); % Exericise 5.13: this cluster assignement will have a rand index of 1.0 ... perfect matching clusters % we pass it the {\em same} arguments c_1 = [ 1; 1; 1; 2; 2 ]; fprintf('adjrand( c_1, c_1 ) = %d\n', adjrand( c_1, c_1 ) ); fprintf('randind( c_1, c_1 ) = %d\n', randind( c_1, c_1 ) );