✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
在分类问题中,数据之间存在的大量冗余、不相关的特征不仅不能增加分类准确率,反而会降低分类算法执行的速度。为了提升特征选择的效率,提出了一种基于二元多邻域人工蜂群 (BMNABC),与其他经典多目标算法在11个UCI测试数据集上的特征选择实验结果表明,提出的算法在减小分类特征数、增大分类结果准确率方面具有显著效果。
⛄ 部分代码
% * Feature Selection Using BMNABC: Binary Multi-Neighborhood Artificial Bee Colony
% * The Code is based on the following paper:
% Zahra Beheshti(2018), BMNABC:
% Optimization Problems, Cybernetics and Systems 49 (7-8), 452-474.
clc
close all
clear all
global A trn vald;
%%
% Dataset
A=load('Im.data'); CaseName='Im'; %Numbers of Features: 270 Numbers of Samples: 1000
%A=load('Zoo.data'); CaseName='Zoo'; %Numbers of Features: 16 Numbers of Samples: 101
%%
N=30; %Colony Size
max_it=100;
Limit=max_it/4; %Number of trials in BMNABC
r=randperm(size(A,1));
trn=r(1:floor(length(r)*0.8)); % Training Set= 80%
vald=r(floor(length(r)*0.8)+1:end); % Testing Set=20%
%/FoodNumber:The number of food sources equals the half of the colony size*/
[BestChart,Error,BestFitness,BestPosition]= BMNABC(N/2,max_it,size(A,2)-1,'AccSz',Limit);
%%
%Output:
q=sum(BestPosition,2); % Selected Features
disp(['Accuracy:',num2str((1-Error)*100), ' #Selected Features=',num2str(q)]);
%%
% Plot
plot(BestChart,'-b');
legend('\fontsize{10}\bf BMNABC');
xlabel('\fontsize{12}\bf Iteration');
ylabel(['\fontsize{11}\bf Average Error for ',CaseName,' Dataset']);
⛄ 运行结果
⛄ 参考文献
Zahra Beheshti(2018), BMNABC: Binary Multi-Neighborhood Artificial Bee Colony for High-Dimensional Discrete Optimization Problems, Cybernetics and Systems 49 (7-8), 452-474.