1个回答
展开全部
function [U,center,result,w,obj_fcn]= fenlei(data)
[data_n,in_n] = size(data);
m= 2; % Exponent for U
max_iter = 100; % Max. iteration
min_impro =1e-5; % Min. improvement
c=3;
[center, U, obj_fcn] = fcm(data, c);
for i=1:max_iter
if F(U)>0.98
break;
else
w_new=eye(in_n,in_n);
center1=sum(center)/c;
a=center1(1)./center1;
deta=center-center1(ones(c,1),:);
w=sqrt(sum(deta.^2)).*a;
for j=1:in_n
w_new(j,j)=w(j);
end
data1=data*w_new;
[center, U, obj_fcn] = fcm(data1, c);
center=center./w(ones(c,1),:);
obj_fcn=obj_fcn/sum(w.^2);
end
end
display(i);
result=zeros(1,data_n);U_=max(U);
for i=1:data_n
for j=1:c
if U(j,i)==U_(i)
result(i)=j;continue;
end
end
end
[data_n,in_n] = size(data);
m= 2; % Exponent for U
max_iter = 100; % Max. iteration
min_impro =1e-5; % Min. improvement
c=3;
[center, U, obj_fcn] = fcm(data, c);
for i=1:max_iter
if F(U)>0.98
break;
else
w_new=eye(in_n,in_n);
center1=sum(center)/c;
a=center1(1)./center1;
deta=center-center1(ones(c,1),:);
w=sqrt(sum(deta.^2)).*a;
for j=1:in_n
w_new(j,j)=w(j);
end
data1=data*w_new;
[center, U, obj_fcn] = fcm(data1, c);
center=center./w(ones(c,1),:);
obj_fcn=obj_fcn/sum(w.^2);
end
end
display(i);
result=zeros(1,data_n);U_=max(U);
for i=1:data_n
for j=1:c
if U(j,i)==U_(i)
result(i)=j;continue;
end
end
end
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
光点科技
2023-08-15 广告
2023-08-15 广告
通常情况下,我们会按照结构模型把系统产生的数据分为三种类型:结构化数据、半结构化数据和非结构化数据。结构化数据,即行数据,是存储在数据库里,可以用二维表结构来逻辑表达实现的数据。最常见的就是数字数据和文本数据,它们可以某种标准格式存在于文件...
点击进入详情页
本回答由光点科技提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询