Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Sample Problem % Half Moon Classifier using RBF % NN toolbox clc; clear all; close all; %% data load('HalfmoonData.mat'); rad = 10; % central radius of the half...

1 answer below »




Sample Problem



% Half Moon


Classifier using RBF


% NN toolbox


clc;


clear all;


close all;


%% data


load('HalfmoonData.mat');


rad = 10;


% central radius of the half moon


width = 6;


% width of the half moon


dist = -4;


% distance between two half moons


% Normalize


data


meanD = [mean(halfmoonData(1:2,:)')';0];


% mean of the original data


maxD


= [max(abs(halfmoonData(1:2,:)'))';1];% max of the original data


norData = mapminmax(halfmoonData(:,:));


net = newrb(norData(1:2,:),norData(3,:),0.01); % Create new RBF NN


%% Test network performance


y = net(norData(1:2,:));


hold on;


% Plot classification results


figure;


hold on;


yOut = ones(1,length(norData));


for i = 1:length(y)


xx


= maxD(1:2,:).*norData(1:2,i) + meanD(1:2,:);


if y(:,i)>0


yOut(:,i) = 1;


plot(xx(1),xx(2),'r*');


end


if y(:,i)<>


yOut(:,i) = -1;


plot(xx(1),xx(2),'ko');


end


end


xlabel('x');ylabel('y');


title(['Classification using MLP with dist = ',num2str(dist), ', radius = ',...


num2str(rad), ' and width = ',num2str(width)]);


% Calculate


accuracy


accuracy = perfCalc(y,halfmoonData(3,:),2)





Answered 1 days After Mar 18, 2023

Solution

Sathishkumar answered on Mar 20 2023
25 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here