% % 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' ); addpath( '../../Code/eda_toolbox' ); close all; drawnow; clc; clear; randn('seed',0); rand('seed',0); % Modified from Example 3.6 Self-Organizing Map % % Use the oronsay data set load oronsay % convert labels to cell array of strings. for i = 1:length(beachdune) mid{i} = int2str(midden(i)); % USE THIS CELL ARRAY IN THIS EXERCISE. bd{i} = int2str(beachdune(i)); end % Normalize each variable to have unit variance and mean 0. D = som_normalize(oronsay,'var'); sD = som_data_struct(D); sD = som_set(sD,'labels',bd'); % Make the SOM sM = som_make(sD); sM = som_autolabel(sM,sD,'vote'); som_show(sM,'umat','all'); som_show_add('label',sM,'subplot',1);