Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Comparative Analysis of GRNN and PNN examples

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "comparative analysis of GRNN and PNN examples". In daily operation, I believe that many people have doubts about the comparative analysis of GRNN and PNN examples. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "comparative analysis of GRNN and PNN examples". Next, please follow the editor to study!

% clear environment variables

Clear

Clc

%% training set / test set generation

% Import data

Load iris_data.mat

% randomly generate training set and test set

P_train = []

T_train = []

P_test = []

T_test = []

For I = 1:3

Temp_input = features ((iMusi 1) * 50mm 1purl 50m:)

Temp_output = classes ((iMusi 1) * 50mm 1purl 50m:)

N = randperm (50)

% training set-120 samples

P_train = [P_train temp_input (n (1:40),:)']

T_train = [T_train temp_output (n (1:40),:)']

% Test set-30 samples

P_test = [P_test temp_input (n (41:50),:)']

T_test = [T_test temp_output (n (41:50),:)']

End

%% Model Building

Result_grnn = []

Result_pnn = []

Time_grnn = []

Time_pnn = []

For I = 1:4

For j = iPUR 4

P_train = P_train (iRU JJ:)

P_test = P_test (iRU JJ:)

%% GRNN creation and simulation test

T = cputime

% create a network

Net_grnn = newgrnn (pawns and Thousand trains)

% Simulation Test

T_sim_grnn = sim (net_grnn,p_test)

T_sim_grnn = round (t_sim_grnn)

T = cputime-t

Time_grnn = [time_grnn t]

Result_grnn = [result_grnn Tunable simplex grnn']

%% PNN creation and simulation test

T = cputime

Tc_train = ind2vec (T_train)

% create a network

Net_pnn = newpnn (pawns, the same as the train)

% Simulation Test

Tc_test = ind2vec (T_test)

T_sim_pnn = sim (net_pnn,p_test)

T_sim_pnn = vec2ind (t_sim_pnn)

T = cputime-t

Time_pnn = [time_pnn t]

Result_pnn = [result_pnn Tunable simplex pnn']

End

End

%% performance evaluation

% correct rate accuracy

Accuracy_grnn = []

Accuracy_pnn = []

Time = []

For I = 1:10

Accuracy_1 = length (find (result_grnn (:, I) = = Tempest') / length (T_test)

Accuracy_2 = length (find (result_pnn (:, I) = = Tempest') / length (T_test)

Accuracy_grnn = [accuracy_grnn accuracy_1]

Accuracy_pnn = [accuracy_pnn accuracy_2]

End

% result comparison

Result = [Tempest 'result_grnn result_pnn]

Accuracy = [accuracy_grnn;accuracy_pnn]

Time = [time_grnn;time_pnn]

%% drawing

Figure (1)

Plot (1RV 30pnn (:, 4), 'rmuri 30pnn (:, 4),' k: ^')

Grid on

Xlabel ('test set sample number')

Ylabel ('test set sample category')

String = {'Test set Forecast comparison (GRNN vs PNN)'; ['accuracy:' num2str (accuracy_grnn (4) * 100)'% (GRNN) vs' num2str (accuracy_pnn (4) * 100)'% (PNN)']}

Title (string)

Legend ('real value', 'GRNN predicted value', 'PNN predicted value')

Figure (2)

Plot (1RV 10Magneol accuracy (1JM:), 'rmuri PUBG', 'rmuri', 'bRAPRO')

Grid on

Xlabel ('model number')

Ylabel ('Test set accuracy')

Title ('Test set accuracy comparison of 10 models (GRNN vs PNN)')

Legend ('GRNN','PNN')

Figure (3)

Plot (1JV 10 time (1 minute:), 'rmuri flowers' 1 minute 10 time (2), 'bju o')

Grid on

Xlabel ('model number')

Ylabel ('run time (s)')

Title ('run time comparison of 10 models (GRNN vs PNN)')

Legend ('GRNN','PNN')

At this point, the study of "comparative analysis of GRNN and PNN examples" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report