[SOLVED] INT301 Lab 13-Self-Organizing Map

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab-of-Week-13-qozrmc.zip (8.8 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

 

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

2. 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)

  • Lab-of-Week-13-qozrmc.zip