data=load('data/kddcup_1_per_conti.txt');
label_all=load('data/kddcup_1_per_label_23','%s');
[nb_data_to_process, nb_f]= size(data);
B_n=1000;
B=data(1:B_n,:);
label=label_all(1:B_n);
[uu_br,idx_bro,kq,idx_br]=uniq_my_rows(B);
S=similarity_nse(B);
p0=median(S(:));
[idx,netsim,dpsim,expref]=apclustermex(S,p0,'maxits',1000,'convits',100, 'dampfact', 0.8);
%%%% cluster = build_cluster(idx,B,label);
[uidx,n]=uniq_my(idx); %%n 58*1向量 1000个点 聚类为58个簇 uidx为聚类代表点所在位置组成的向量 n为每个簇的数据点数目组成的向量
cluster.n=n; clear n %% n为每个簇的数据点数目组成的向量
cluster.ex=B(uidx,:); %% uidx为聚类代表点所在位置组成的向量 从B中提取出这58个代表点
cluster.ex_idx=uidx; %% uidx为聚类代表点所在位置组成的向量
cluster.meanstd=[];
cluster.label=label(uidx);
cluster.label_all={};
cluster.touch=repmat(size(B,1),length(cluster.n),1);
k=1
elem=find(idx==uidx(k));
29 43 117 144 311 670 867 873 911 926 984
tem1=repmat(cluster.ex(k,:),length(elem),1) - B(elem,:);