【数据聚类】基于Baysian、KNN、3Layer Neural Network Classifier、KMeans多种算法实现数据聚类附matlab代码

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

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

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

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

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

⛄ 内容介绍

基于Baysian、KNN、3Layer Neural Network Classifier、KMeans多种算法实现数据聚类附matlab代码

⛄ 部分代码

function autoArrangeFigures(NH, NW)

% INPUT  :

%        NH : number of grid of height direction

%        NW : number of grid of width direction

% OUTPUT :

%

% get every figures that are opened now and arrange them.

%

% autoArrangeFigures selects automatically Monitor1.

% If you are dual(or more than that) monitor user, I recommend to set wide

% monitor as Monitor1.

%

% if you want arrange automatically, type 'autoArrangeFigures(0,0)' or 'autoArrangeFigures()'. 

%    But maximum number of figures for automatic mode is 27.

%

% if you want specify grid for figures, give numbers for parameters.

%    but if your grid size is smaller than required one for accommodating

%    all figures, this function changes to automatic mode and if more

%    figures are opend than maximum number, then it gives error.

% leejaejun, Koreatech, Korea Republic, 2014.12.13

% jaejun0201@gmail.com

% you can get this file in Matlab file exchange

% http://www.mathworks.com/matlabcentral/fileexchange/48480-automatically-arrange-figure-windows

if nargin < 2

    NH = 0;

    NW = 0;

end

N_FIG = NH * NW;

if N_FIG == 0

    autoArrange = 1;

else

    autoArrange = 0;

end

figHandle = sort(findobj('Type','figure'));

n_fig = size(figHandle,1);

if n_fig <= 0

    warning('figures are not found');

    return

end

screen_sz = get(0,'ScreenSize');

scn_h = screen_sz(4);

scn_w = screen_sz(3);

if autoArrange==0

    if n_fig > N_FIG

        autoArrange = 1;

        warning('too many figures than you told. change to autoArrange');

    else

        nh = NH;

        nw = NW;

    end

end

if autoArrange == 1

    grid = [2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4;

            3 3 3 3 3 3 3 3 4 4 4 5 5 5 5 5 5 5 5 6 6 6 7 7 7 7 7]';

   

    if n_fig > length(grid)

        warning('too many figures(maximum = %d)',length(grid))

        return

    end

    

    if scn_w > scn_h

        nh = grid(n_fig,1);

        nw = grid(n_fig,2);

    else

        nh = grid(n_fig,2);

        nw = grid(n_fig,1);

    end

end

fig_h = (scn_h-50)/nh;

fig_w = scn_w/nw;

fig_cnt = 1;

for i=1:1:nh

    for k=1:1:nw

        if fig_cnt>n_fig

            return

        end

        fig_pos = [1+fig_w*(k-1) scn_h-fig_h*i fig_w fig_h];

        set(figHandle(fig_cnt),'OuterPosition',fig_pos);

        fig_cnt = fig_cnt + 1;

    end

end

end

⛄ 运行结果

⛄ 参考文献

[1]朱昌明, 张默. 基于核聚类的K-均值聚类(英文)[J]. 上海海事大学学报, 2017, 38(2):7.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

matlab科研助手

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

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

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

打赏作者

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

抵扣说明:

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

余额充值