【数据聚类】改进多元宇宙算法优化密度的噪声应用空间聚类MVO-DBSCAN数据聚类【含Matlab源码 7213期】

在这里插入图片描述

⛄一、获取代码方式

获取代码方式1:
完整代码已上传我的资源:【数据聚类】基于matlab改进多元宇宙算法优化密度的噪声应用空间聚类MVO-DBSCAN数据聚类【含Matlab源码 7213期】
点击上面蓝色字体,直接付费下载,即可。

获取代码方式2:
付费专栏数据分析(Matlab)

备注:
点击上面蓝色字体付费专栏数据分析(Matlab),扫描上面二维码,付费299.9元订阅海神之光博客付费专栏,凭支付凭证,私信博主,可免费获得5份本博客上传CSDN资源代码(有效期为订阅日起,三天内有效);
点击CSDN资源下载链接:5份本博客上传CSDN资源代码

⛄二、部分源代码

clc
clear
close all

dataStorage = ‘Datasets’;
resultPath =‘results’;
if ~exist(resultPath,‘dir’)
mkdir(resultPath);
end

DataReposity = {‘artificial’};

Algorithms ={‘MVO-DBSCAN’,‘IMVO1-DBSCAN’,‘IMVO2-DBSCAN’,‘DBSCAN’};
MaxRun = 1;

for rep = 1:length(DataReposity)
rep
dataPath = [dataStorage,DataReposity{rep},‘’];

pathInfo = dir([dataPath,'*.txt']);

for ii = 1:length(pathInfo)
    temp = strsplit(pathInfo(ii).name,'.');
    dataNames{ii} = temp{1};
end

for i = 1:length(dataNames)
    dataName = dataNames{i};
    data = LoadDataset(dataPath,DataReposity{rep},dataName);
    data.dataName = dataName;
    
    for j = 1:length(Algorithms)
        AlgName = Algorithms{j}
        inits  = initialization(DataReposity{rep},data,AlgName);
        
        for run = 1:MaxRun
            
            if strcmp(AlgName,'MVO-DBSCAN')
                
                % execute clustering method on the problem
                out = MVO_DBSCAN(inits.prob,inits.params);
                clus = out.ptsC;
                C = out.C;
                Nc = out.Nc;
                
            end
            
            if strcmp(AlgName,'IMVO1-DBSCAN')
                
                % execute clustering method on the problem
                out = IMVO1_DBSCAN(inits.prob,inits.params);
                clus = out.ptsC;
                C = out.C;
                Nc = out.Nc;
                
            end
            
            if strcmp(AlgName,'IMVO2-DBSCAN')
                
                % execute clustering method on the problem
                out = IMVO2_DBSCAN(inits.prob,inits.params);
                clus = out.ptsC;
                C = out.C;
                Nc = out.Nc;
                
            end
            
            if strcmp(AlgName,'DBSCAN')
                
                % execute clustering method on the problem
                X = data.X; % points
                [ptsC,C,Nc,Pvisit] = dbscan(X', inits.E, inits.minPts);
                clus = ptsC;
                
            end
            
            %% save results
            savePath = [resultPath,DataReposity{rep},'\',AlgName,'\'];
            if ~exist(savePath,'dir')
                mkdir(savePath);
            end
            
            if run == 1
                if  size(data.X,2) == 2
                    h = PlotClusteringResults(data.X,clus);
                    print(h,[savePath,dataName],'-djpeg','-r300')
                    close(h);
                end
                if strcmp(AlgName,'DBSCAN')
                    save([savePath,dataName,'_outs'],'clus','C','Nc');
                else
                    GlobalBest = out.GlobalBest;
                    save([savePath,dataName,'_outs'],'clus','C','Nc','GlobalBest');
                end
                
            end
            
            %%  Evaluation
            [results{i}.MeanAccuracy(run,j),results{i}.err(run,j)] = ...
                ClusteringEvaluation1(clus,data.y);
            [results{i}.F_measure(run,j)] =  ClusteringEvaluation2(clus,data.y);
            
        end
    end
    results{i}.dataName = dataName;
    
end
save([resultPath,DataReposity{rep},'\','results'],'results');
% bar plot
resultName = 'results';
barPlots([resultPath,DataReposity{rep},'\'],resultName,dataNames,Algorithms);
clear results dataNames

end

⛄三、运行结果

在这里插入图片描述

⛄四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 由伟,刘亚秀.MATLAB数据分析教程[M].清华大学出版社,2020.
[2]王岩,隋思涟.试验设计与MATLAB数据分析[M].清华大学出版社,2012.

3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Matlab领域

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

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

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

打赏作者

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

抵扣说明:

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

余额充值