【数据分析】基于Matlab实现粒子群优化的模糊专家系统

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法  神经网络预测 雷达通信  无线传感器

信号处理 图像处理 路径规划 元胞自动机 无人机

⛄ 内容介绍

The intelligent decision making systems are useful tools for the assistance of human expert, and or as a perfect alternative for expert in a variety of auto-decision making fields. The use of such systems in education, agriculture, industry, fishery, animal husbandry etc., can decrease manpower errors or need of it; In the other hand, it can increase the quality and the pace of service giving. The interview at the PH.D level or even Master's degree, due to the high sensitivity in scoring to the candidates, is of high importance. Therefore, creating a system for storing these scores, and inferring the results can be beneficial when there is a large number of candidates. In this paper, the expert system has an educational use, and classifies the probability of acceptance or unacceptance of PH.D candidates in the exam and interview, based on the (National Organization of Educational Testing) NOET measures, also estimates scientific level of candidates. The proposed fuzzy-expert system takes advantage of the particle swarm optimization (PSO) evolutionary algorithm to specifying the score of each variable, and eventually the final condition of the candidate. The acquired results of evaluating the fuzzy-expert system proves its functionality. This system is also able to function well in scoring similar educational cases to specify acceptance.

⛄ 部分代码

clear

clc

close all

load DB

%%%%%%%%%%%%%%%%%%%%Optimization with PSO%%%%%%%%%%%%%%%%

disp('**********************************');

PSO_EasyLevel

EasyLevelRanges=gbest(end,:);

disp('**********************************');

disp(['**Rejected Level Ranges:   ' , num2str(EasyLevelRanges)]);

disp(['  fittness:   ',num2str(gbestcost(end))]);

figure

disp('**********************************');

PSO_ModerateLevel

ModerateLevelRanges=gbest(end,:);

disp('**********************************');

disp(['**Most Likely Level Ranges:   ' , num2str(ModerateLevelRanges)]);

disp(['  fittness:   ',num2str(gbestcost(end))]);

figure

disp('**********************************');

PSO_HardLevel

HardLevelRanges=gbest(end,:);

disp('**********************************');

disp(['**Accepted Level Ranges:   ' , num2str(HardLevelRanges)]);

disp(['  fittness:   ',num2str(gbestcost(end))]);

disp('**********************************');

%%%%%%%%%%%%%%%%%%%Fuzzy Step%%%%%%%%%%%%%%%%%%

easy =[easy(:,1)*(EasyLevelRanges(2)-EasyLevelRanges(1))/(max(easy(:,1))-min(easy(:,1)))...

       easy(:,2)*(EasyLevelRanges(4)-EasyLevelRanges(3))/(max(easy(:,2))-min(easy(:,2)))...

       easy(:,3)*(EasyLevelRanges(6)-EasyLevelRanges(5))/(max(easy(:,3))-min(easy(:,3)))...

       easy(:,4)*(EasyLevelRanges(8)-EasyLevelRanges(7))/(max(easy(:,4))-min(easy(:,4)))...

       easy(:,5)*(EasyLevelRanges(10)-EasyLevelRanges(9))/(max(easy(:,5))-min(easy(:,5)))...

       easy(:,6)*(EasyLevelRanges(12)-EasyLevelRanges(11))/(max(easy(:,6))-min(easy(:,6)))...

       easy(:,7)*(EasyLevelRanges(14)-EasyLevelRanges(13))/(max(easy(:,7))-min(easy(:,7)))...

       easy(:,8)*(EasyLevelRanges(16)-EasyLevelRanges(15))/(max(easy(:,8))-min(easy(:,8)))...

       easy(:,9)*(EasyLevelRanges(18)-EasyLevelRanges(17))/(max(easy(:,9))-min(easy(:,9)))...

       easy(:,10)*(EasyLevelRanges(20)-EasyLevelRanges(19))/(max(easy(:,10))-min(easy(:,10)))];

moderate =[moderate(:,1)*(ModerateLevelRanges(2)-ModerateLevelRanges(1))/(max(moderate(:,1))-min(moderate(:,1)))...

           moderate(:,2)*(ModerateLevelRanges(4)-ModerateLevelRanges(3))/(max(moderate(:,2))-min(moderate(:,2)))...

           moderate(:,3)*(ModerateLevelRanges(6)-ModerateLevelRanges(5))/(max(moderate(:,3))-min(moderate(:,3)))...

           moderate(:,4)*(ModerateLevelRanges(8)-ModerateLevelRanges(7))/(max(moderate(:,4))-min(moderate(:,4)))...

           moderate(:,5)*(ModerateLevelRanges(10)-ModerateLevelRanges(9))/(max(moderate(:,5))-min(moderate(:,5)))...

           moderate(:,6)*(ModerateLevelRanges(12)-ModerateLevelRanges(11))/(max(moderate(:,6))-min(moderate(:,6)))...

           moderate(:,7)*(ModerateLevelRanges(14)-ModerateLevelRanges(13))/(max(moderate(:,7))-min(moderate(:,7)))...

           moderate(:,8)*(ModerateLevelRanges(16)-ModerateLevelRanges(15))/(max(moderate(:,8))-min(moderate(:,8)))...

           moderate(:,9)*(ModerateLevelRanges(18)-ModerateLevelRanges(17))/(max(moderate(:,9))-min(moderate(:,9)))...

           moderate(:,10)*(ModerateLevelRanges(20)-ModerateLevelRanges(19))/(max(moderate(:,10))-min(moderate(:,10)))];

   

hard =[hard(:,1)*(HardLevelRanges(2)-HardLevelRanges(1))/(max(hard(:,1))-min(hard(:,1)))...

       hard(:,2)*(HardLevelRanges(4)-HardLevelRanges(3))/(max(hard(:,2))-min(hard(:,2)))...

       hard(:,3)*(HardLevelRanges(6)-HardLevelRanges(5))/(max(hard(:,3))-min(hard(:,3)))...

       hard(:,4)*(HardLevelRanges(8)-HardLevelRanges(7))/(max(hard(:,4))-min(hard(:,4)))...

       hard(:,5)*(HardLevelRanges(10)-HardLevelRanges(9))/(max(hard(:,5))-min(hard(:,5)))...

       hard(:,6)*(HardLevelRanges(12)-HardLevelRanges(11))/(max(hard(:,6))-min(hard(:,6)))...

       hard(:,7)*(HardLevelRanges(14)-HardLevelRanges(13))/(max(hard(:,7))-min(hard(:,7)))...

       hard(:,8)*(HardLevelRanges(16)-HardLevelRanges(15))/(max(hard(:,8))-min(hard(:,8)))...

       hard(:,9)*(HardLevelRanges(18)-HardLevelRanges(17))/(max(hard(:,9))-min(hard(:,9)))...

       hard(:,10)*(HardLevelRanges(20)-HardLevelRanges(19))/(max(hard(:,10))-min(hard(:,10)))];

   

Xin  = [easy;moderate;hard];

Xout = [ones(size(easy,1),1);2*ones(size(moderate,1),1);3*ones(size(hard,1),1)];

fismat = genfis3(Xin,Xout,'mamdani',10);

fismat = setfis(fismat, 'name', 'Sanjesh Expert System');

fismat = setfis(fismat,'output',1, 'name', 'Condition');

fismat = setfis(fismat,'input',1, 'name', 'Ex-uni Length');

fismat = setfis(fismat,'input',2, 'name', 'Ex-uni Average');

fismat = setfis(fismat,'input',3, 'name', 'Olympiad Chosen');

fismat = setfis(fismat,'input',4, 'name', 'Ex-Uni Quality');

fismat = setfis(fismat,'input',5, 'name', 'IELTS');

fismat = setfis(fismat,'input',6, 'name', 'Papers');

fismat = setfis(fismat,'input',7, 'name', 'Festival Chosen');

fismat = setfis(fismat,'input',8, 'name', 'Compilation,Translation,Invention');

fismat = setfis(fismat,'input',9, 'name', 'Msc Thesis Quality');

fismat = setfis(fismat,'input',10, 'name', 'Interviews Test');

fismat = setfis(fismat,'output',1,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'output',1,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'output',1,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',1,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',1,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',1,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',2,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',2,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',2,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',3,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',3,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',3,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',4,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',4,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',4,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',5,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',5,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',5,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',6,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',6,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',6,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',7,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',7,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',7,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',8,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',8,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',8,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',9,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',9,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',9,'mf', 3, 'name', 'H');

fismat = setfis(fismat,'input',10,'mf', 1, 'name', 'L');

fismat = setfis(fismat,'input',10,'mf', 2, 'name', 'M');

fismat = setfis(fismat,'input',10,'mf', 3, 'name', 'H');

figure

plotfis(fismat);

figure

[x,mf] = plotmf(fismat,'input',1);

subplot(5,1,1), plot(x,mf);

xlabel('Membership Functions for Ex-uni Length');

[x,mf] = plotmf(fismat,'input',2);

subplot(5,1,2), plot(x,mf);

xlabel('Membership Functions for Ex-uni Average');

[x,mf] = plotmf(fismat,'input',3);

subplot(5,1,3), plot(x,mf);

xlabel('Membership Functions for Olympiad Chosen');

[x,mf] = plotmf(fismat,'input',4);

subplot(5,1,4), plot(x,mf);

xlabel('Membership Functions for Ex-Uni Quality');

[x,mf] = plotmf(fismat,'input',5);

subplot(5,1,5), plot(x,mf);

xlabel('Membership Functions for IELTS');

figure

[x,mf] = plotmf(fismat,'input',6);

subplot(5,1,1), plot(x,mf);

xlabel('Membership Functions for Papers');

[x,mf] = plotmf(fismat,'input',7);

subplot(5,1,2), plot(x,mf);

xlabel('Membership Functions for Festival Chosen');

[x,mf] = plotmf(fismat,'input',8);

subplot(5,1,3), plot(x,mf);

xlabel('Membership Functions for Compilation,Translation,Invention');

[x,mf] = plotmf(fismat,'input',9);

subplot(5,1,4), plot(x,mf);

xlabel('Membership Functions for Msc Thesis Quality');

[x,mf] = plotmf(fismat,'input',10);

subplot(5,1,5), plot(x,mf);

xlabel('Membership Functions for Interviews Test');

figure

[x,mf] = plotmf(fismat,'output',1);

subplot(5,1,1), plot(x,mf);

xlabel('Membership Functions for Condition(output)');

fismat.defuzzMethod='centroid'; %or 'mom'

writefis(fismat,'expert system.fis');

ruleview('expert system')

showfis(fismat)

fuzzy(fismat)

⛄ 运行结果

⛄ 参考文献

Mousavi, Seyed Muhammad Hossein, et al. "A PSO fuzzy-expert system: As an assistant for specifying the acceptance by NOET measures, at PH. D level." 2017 Artificial Intelligence and Signal Processing Conference (AISP). IEEE, 2017.

❤️ 关注我领取海量matlab电子书和数学建模资料

❤️部分理论引用网络文献,若有侵权联系博主删除

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值