[SOLVED] INT301- Week 13: Self-Organizing Map

20.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

Rate this product

Example:

Clustering Problem using a Self-Organizing Map (demo.m)

close all, clear all, clc, format compact  load simplecluster_dataset;

% a 2×1000 matrix of 1000 two-element vectors. x = simpleclusterInputs;  % plot clusters  figure, plot(x(1,:),x(2,:),’g.’); hold on

grid on

% Create a Self-Organizing Map  dim1 = 10;  dim2 = 10;

net = selforgmap([dim1 dim2]);  % Train the Network

[net,tr] = train(net,x);

 

% View the Network  view(net)  % Plots  figure, plotsomtop(net)  figure, plotsomnc(net) figure, plotsomnd(net)  figure, plotsomplanes(net)  figure, plotsomhits(net,x)

figure, plotsompos(net,x)

 

Exercise:

  1. Define 4 clusters of input data with the following piece of code, and plot input data using your own codes;

 

% number of samples of each cluster

K = 200;  % offset of classes  q = 1.1;

% define 4 clusters of input data

P = [rand(1,K)-q rand(1,K)+q rand(1,K)+q rand(1,K)-q; rand(1,K)+q rand(1,K)+q rand(1,K)-q rand(1,K)-q];

 

%% Your own codes

  1. Create and train 2D-SOM with the following parameters using your own codes, and plot the 2D-SOM results with the following functions (you can also change the parameters accordingly).

 

% SOM parameters

dimensions = [10 10];

%% Your own codes

% plot input data and SOM weight positions  figure, plotsompos(net, P); grid on  % plot SOM neighbor distances  figure, plotsomnd(net)

% plot for each SOM neuron the number of input vectors that it classifies  figure, plotsomhits(net,P)

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.