Commit 010a99af authored by Carlos Mejia's avatar Carlos Mejia
Browse files

Conversion dos2unix de tout *.m

parent 273f9aad
function [clust, clcell, clcellConsol, DB_index]=CAHOM(sMap,bmus,Nbclust,TypeCAH,CAHIndex) function [clust, clcell, clcellConsol, DB_index]=CAHOM(sMap,bmus,Nbclust,TypeCAH,CAHIndex)
% sMap : ta carte % sMap : ta carte
% msize: les dimensions de ta cartes exemple : [10 10] % msize: les dimensions de ta cartes exemple : [10 10]
% name : un nom banale pour identifier nommer ta carte exemple : 'OM' % name : un nom banale pour identifier nommer ta carte exemple : 'OM'
% bmus le bmus initial associ? ? sMap exemple : bah c'est le bmus quoi !!! % bmus le bmus initial associ? ? sMap exemple : bah c'est le bmus quoi !!!
% Nbclust le nombre de classe souhaite exemple : 7 % Nbclust le nombre de classe souhaite exemple : 7
% CAH contrainte et consolid?e % CAH contrainte et consolid?e
% TypeCAH='My'; consolide % TypeCAH='My'; consolide
CahCluster1 = som_cllinkage(sMap,CAHIndex,'connect','neighbors'); CahCluster1 = som_cllinkage(sMap,CAHIndex,'connect','neighbors');
%[Dendro1]=som_dendrogram(CahCluster1.tree,sMap,'colorthreshold','default'); %[Dendro1]=som_dendrogram(CahCluster1.tree,sMap,'colorthreshold','default');
%set(Dendro1,'LineWidth',2); %set(Dendro1,'LineWidth',2);
DB_index=[]; DB_index=[];
nb_clust=2; nb_clust=2;
while nb_clust<20, while nb_clust<20,
clust=cluster(CahCluster1.tree,'maxclust',nb_clust); clust=cluster(CahCluster1.tree,'maxclust',nb_clust);
DB_index(nb_clust)=db_index(sMap,clust); DB_index(nb_clust)=db_index(sMap,clust);
nb_clust=nb_clust+1; nb_clust=nb_clust+1;
end end
DB_index(1)=DB_index(2); DB_index(1)=DB_index(2);
[A,B]=min(DB_index); [A,B]=min(DB_index);
plot([1:19],DB_index,'--bs','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','r','MarkerSize',3); plot([1:19],DB_index,'--bs','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','r','MarkerSize',3);
%xlabel('Clustering'); %xlabel('Clustering');
%ylabel('Indice de Davie-Bouldin'); %ylabel('Indice de Davie-Bouldin');
clust=cluster(CahCluster1.tree,'maxclust',Nbclust); clust=cluster(CahCluster1.tree,'maxclust',Nbclust);
clcell=clust; clcell=clust;
%%%%%%%%%%%%%% consolidation des cartes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%% consolidation des cartes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
uniq=unique(clust); uniq=unique(clust);
MyCentroids=zeros(length(uniq),size(sMap.codebook,2)); MyCentroids=zeros(length(uniq),size(sMap.codebook,2));
for i=1:length(unique(clust)) for i=1:length(unique(clust))
MyCentroids(i,:)=mean(sMap.codebook(find(clust==uniq(i)),:)); MyCentroids(i,:)=mean(sMap.codebook(find(clust==uniq(i)),:));
end end
[Clust ClConsol]=som_kmeans('batch',sMap,Nbclust,TypeCAH,MyCentroids); [Clust ClConsol]=som_kmeans('batch',sMap,Nbclust,TypeCAH,MyCentroids);
ClConsol=ClConsol'; ClConsol=ClConsol';
clcellConsol=ClConsol; clcellConsol=ClConsol;
Carte=[clust,ClConsol]; Carte=[clust,ClConsol];
%pour la structure carte%%%%%%% rajout des label%%% %pour la structure carte%%%%%%% rajout des label%%%
for k=1:Nbclust for k=1:Nbclust
pos1=find(clust==k); pos1=find(clust==k);
pos2=find(ClConsol==k); pos2=find(ClConsol==k);
for i=1:size(pos1,1) for i=1:size(pos1,1)
clust_obs(bmus==pos1(i))=k; %#ok<AGROW> clust_obs(bmus==pos1(i))=k; %#ok<AGROW>
end end
for j=1:size(pos2,1) for j=1:size(pos2,1)
clust_obsConsol(bmus==pos2(j))=k; %#ok<AGROW> clust_obsConsol(bmus==pos2(j))=k; %#ok<AGROW>
end end
end end
clust=[clust_obs; clust_obsConsol]; clust=[clust_obs; clust_obsConsol];
clust=clust'; clust=clust';
% comparaison multiple % comparaison multiple
AnovaTest1=reshape(Res,100,1); AnovaTest1=reshape(Res,100,1);
AnovaTest2=reshape(Res',100,1); AnovaTest2=reshape(Res',100,1);
subplot(211) subplot(211)
[p,t,st1] = anova1(AnovaTest1,label,'off'); [p,t,st1] = anova1(AnovaTest1,label,'off');
[c,m,h,nms] = multcompare(st1,'estimate','kruskalwallis','display','on'); [c,m,h,nms] = multcompare(st1,'estimate','kruskalwallis','display','on');
subplot(212) subplot(212)
[p,t,st2] = anova1(AnovaTest2,label,'off'); [p,t,st2] = anova1(AnovaTest2,label,'off');
[c,m,h,nms] = multcompare(st2,'estimate','kruskalwallis','display','on'); [c,m,h,nms] = multcompare(st2,'estimate','kruskalwallis','display','on');
function [ vec ] = Disjonctif(Bmus,Nb_Cell) function [ vec ] = Disjonctif(Bmus,Nb_Cell)
%UNTITLED10 Summary of this function goes here %UNTITLED10 Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
%Var est un vecteur contenant la position de la modalité maximale pour %Var est un vecteur contenant la position de la modalité maximale pour
%chaque referent %chaque referent
DimX=length(Bmus); DimX=length(Bmus);
Disj=zeros(Nb_Cell,DimX); Disj=zeros(Nb_Cell,DimX);
%modality=unique(Bmus); %modality=unique(Bmus);
for i=1:Nb_Cell for i=1:Nb_Cell
vec=zeros(1,DimX); vec=zeros(1,DimX);
for j=1:DimX for j=1:DimX
vec(Bmus==i)=1; vec(Bmus==i)=1;
end end
Disj(i,:)=vec; Disj(i,:)=vec;
end end
end end
function [distorsion Result] = Distorsion( Result, D,Nbclust) function [distorsion Result] = Distorsion( Result, D,Nbclust)
%UNTITLED4 Summary of this function goes here %UNTITLED4 Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
Dim=size(Result);distorsion=zeros(Dim(1),Dim(2)); Dim=size(Result);distorsion=zeros(Dim(1),Dim(2));
for i=1:Dim(1) for i=1:Dim(1)
for j=1:Dim(2) for j=1:Dim(2)
Dist=0.0; Dist=0.0;
for k=1:size(Result(i,j).res,2) for k=1:size(Result(i,j).res,2)
Dist=Dist+som_distortion(Result(i,j).res(k).sMap,D)/size(D,2); Dist=Dist+som_distortion(Result(i,j).res(k).sMap,D)/size(D,2);
[Result(i,j).res(k).cl Result(i,j).CellCl(:,k) Result(i,j).CellConSol(:,k)]=CAHOM(Result(i,j).res(k).sMap,Result(i,j).res(k).bmus,Nbclust,'My','ward'); [Result(i,j).res(k).cl Result(i,j).CellCl(:,k) Result(i,j).CellConSol(:,k)]=CAHOM(Result(i,j).res(k).sMap,Result(i,j).res(k).bmus,Nbclust,'My','ward');
end end
distorsion(i,j)=Dist/10; distorsion(i,j)=Dist/10;
end end
end end
end end
function EVAL = Evaluate(ACTUAL,PREDICTED) function EVAL = Evaluate(ACTUAL,PREDICTED)
% This fucntion evaluates the performance of a classification model by % This fucntion evaluates the performance of a classification model by
% calculating the common performance measures: Accuracy, Sensitivity, % calculating the common performance measures: Accuracy, Sensitivity,
% Specificity, Precision, Recall, F-Measure, G-mean. % Specificity, Precision, Recall, F-Measure, G-mean.
% Input: ACTUAL = Column matrix with actual class labels of the training % Input: ACTUAL = Column matrix with actual class labels of the training
% examples % examples
% PREDICTED = Column matrix with predicted class labels by the % PREDICTED = Column matrix with predicted class labels by the
% classification model % classification model
% Output: EVAL = Row matrix with all the performance measures % Output: EVAL = Row matrix with all the performance measures
idx = (ACTUAL()==1); idx = (ACTUAL()==1);
p = length(ACTUAL(idx)); p = length(ACTUAL(idx));
n = length(ACTUAL(~idx)); n = length(ACTUAL(~idx));
N = p+n; N = p+n;
tp = sum(ACTUAL(idx)==PREDICTED(idx)); tp = sum(ACTUAL(idx)==PREDICTED(idx));
tn = sum(ACTUAL(~idx)==PREDICTED(~idx)); tn = sum(ACTUAL(~idx)==PREDICTED(~idx));
fp = n-tn; fp = n-tn;
fn = p-tp; fn = p-tp;
tp_rate = tp/p; tp_rate = tp/p;
tn_rate = tn/n; tn_rate = tn/n;
accuracy = (tp+tn)/N; accuracy = (tp+tn)/N;
sensitivity = tp_rate; sensitivity = tp_rate;
specificity = tn_rate; specificity = tn_rate;
precision = tp/(tp+fp); precision = tp/(tp+fp);
recall = sensitivity; recall = sensitivity;
f_measure = 2*((precision*recall)/(precision + recall)); f_measure = 2*((precision*recall)/(precision + recall));
gmean = sqrt(tp_rate*tn_rate); gmean = sqrt(tp_rate*tn_rate);
EVAL = [accuracy sensitivity specificity precision recall f_measure gmean]; EVAL = [accuracy sensitivity specificity precision recall f_measure gmean];
\ No newline at end of file
This diff is collapsed.
addpath(['.' filesep '2s_somtoolboxmixed']) addpath(['.' filesep '2s_somtoolboxmixed'])
addpath(['.' filesep '2s_somtoolboxmixed' filesep 'ConsensensClustering']) addpath(['.' filesep '2s_somtoolboxmixed' filesep 'ConsensensClustering'])
addpath(['.' filesep '2s_somtoolboxmixed' filesep 'NCEstimation']) addpath(['.' filesep '2s_somtoolboxmixed' filesep 'NCEstimation'])
%% Utilisation de 2S-SOM %% Utilisation de 2S-SOM
D=som_normalize(data,'var'); D=som_normalize(data,'var');
DimData=[7 4 10]; DimData=[7 4 10];
DimBloc(1).Dim=7 DimBloc(1).Dim=7
DimBloc(2).Dim=4 DimBloc(2).Dim=4
DimBloc(3).Dim=10 DimBloc(3).Dim=10
[sMap1 Bmus]=som_make(D,'init','randinit'); %% Initialisation des param?tres de SOM [sMap1 Bmus]=som_make(D,'init','randinit'); %% Initialisation des param?tres de SOM
[cl cellOR ]=CAHOM(sMap1,Bmus,Nbclust,'My','ward'); [cl cellOR ]=CAHOM(sMap1,Bmus,Nbclust,'My','ward');
Perf=comparaison_partitionOM(Labels,cl(:,1)); Perf=comparaison_partitionOM(Labels,cl(:,1));
%Result=struct; %Result=struct;
for i=1:M for i=1:M
for j=1:M for j=1:M
for k=1:K for k=1:K
[sMap1 Bmus]=som_make(D,'init','randinit'); %% Initialisation des param?tres de SOM [sMap1 Bmus]=som_make(D,'init','randinit'); %% Initialisation des param?tres de SOM
[Result(i,j).sMap(k).sMap Result(i,j).bmus(k).bmus Result(i,j).Alpha(k).Alpha Result(i,j).Beta(k).Beta]=SS_SOM(sMap1, D,'TypeAlgo','2SSOM','DimData',DimData,'DimBloc',DimBloc,'lambda',2,'eta',50,'trainlen',50); [Result(i,j).sMap(k).sMap Result(i,j).bmus(k).bmus Result(i,j).Alpha(k).Alpha Result(i,j).Beta(k).Beta]=SS_SOM(sMap1, D,'TypeAlgo','2SSOM','DimData',DimData,'DimBloc',DimBloc,'lambda',2,'eta',50,'trainlen',50);
end end
end end
end end
%% Recup?ration de classes suite ? une CAH sur la sortie 2S-SOM %% Recup?ration de classes suite ? une CAH sur la sortie 2S-SOM
CAHIndex='ward'; CAHIndex='ward';
for i=1:M for i=1:M
for j=1:M for j=1:M
for k=1:5 for k=1:5
[Result(i,j).cl(k).cl Result(i,j).cellOR(k).cellOR]=CAHOM(Result(i,j).sMap(k).sMap,Result(i,j).bmus(k).bmus,Nbclust,'My',CAHIndex); [Result(i,j).cl(k).cl Result(i,j).cellOR(k).cellOR]=CAHOM(Result(i,j).sMap(k).sMap,Result(i,j).bmus(k).bmus,Nbclust,'My',CAHIndex);
Result(i,j).Perf(k).Perf=comparaison_partitionOM(Labels,Result(i,j).cl(k).cl(:,1)); Result(i,j).Perf(k).Perf=comparaison_partitionOM(Labels,Result(i,j).cl(k).cl(:,1));
end end
end end
end end
% Recup?ration des index particuliers % Recup?ration des index particuliers
for i=1:M for i=1:M
for j=1:M for j=1:M
for k=1:5 for k=1:5
PerfNMI1(k)=Result(i,j).Perf(k).Perf.indice.nmi; PerfNMI1(k)=Result(i,j).Perf(k).Perf.indice.nmi;
PerfAdjustedRand1(k)=Result(i,j).Perf(k).Perf.indice.AdusjtedRand; PerfAdjustedRand1(k)=Result(i,j).Perf(k).Perf.indice.AdusjtedRand;
PerfAccu1(k)=Result(i,j).Perf(k).Perf.Performance.Accuracy; PerfAccu1(k)=Result(i,j).Perf(k).Perf.Performance.Accuracy;
end end
PerfNMI(i,j)=mean(PerfNMI1); PerfNMI(i,j)=mean(PerfNMI1);
PerfAdjustedRand(i,j)=mean(PerfAdjustedRand1); PerfAdjustedRand(i,j)=mean(PerfAdjustedRand1);
PerfAccu(i,j)=mean(PerfAccu1); PerfAccu(i,j)=mean(PerfAccu1);
% %
PerfNMI_Var(i,j)=std(PerfNMI1); PerfNMI_Var(i,j)=std(PerfNMI1);
PerfAdjustedRand_Var(i,j)=std(PerfAdjustedRand1); PerfAdjustedRand_Var(i,j)=std(PerfAdjustedRand1);
PerfAccu_Var(i,j)=std(PerfAccu1); PerfAccu_Var(i,j)=std(PerfAccu1);
end end
end end
% Apprentissage Kmeansi % Apprentissage Kmeansi
for k=1:20 for k=1:20
ClKmeans(:,k)=kmeans(D,Nbclust); ClKmeans(:,k)=kmeans(D,Nbclust);
PerfKmeans(k).Perf=comparaison_partitionOM(Labels,ClKmeans(:,k)); PerfKmeans(k).Perf=comparaison_partitionOM(Labels,ClKmeans(:,k));
PerfKmeansNMI(k)=PerfKmeans(k).Perf.indice.nmi; PerfKmeansNMI(k)=PerfKmeans(k).Perf.indice.nmi;
PerfKmeansAdjustedRand(k)=PerfKmeans(k).Perf.indice.AdusjtedRand; PerfKmeansAdjustedRand(k)=PerfKmeans(k).Perf.indice.AdusjtedRand;
PerfKmeansAccu(k)=PerfKmeans(k).Perf.Performance.Accuracy; PerfKmeansAccu(k)=PerfKmeans(k).Perf.Performance.Accuracy;
end end
% Apprentissage SOM % Apprentissage SOM
for k=1:20 for k=1:20
[SOM(k).sMap1 SOM(k).Bmus]=som_make(D,'init','randinit'); %% Initialisation des param?tres de SOM [SOM(k).sMap1 SOM(k).Bmus]=som_make(D,'init','randinit'); %% Initialisation des param?tres de SOM
[SOM(k).cl SOM(k).cellOR ]=CAHOM(SOM(k).sMap1,SOM(k).Bmus,Nbclust,'My',CAHIndex); [SOM(k).cl SOM(k).cellOR ]=CAHOM(SOM(k).sMap1,SOM(k).Bmus,Nbclust,'My',CAHIndex);
SOM(k).Perf=comparaison_partitionOM(Labels,SOM(k).cl(:,1)); SOM(k).Perf=comparaison_partitionOM(Labels,SOM(k).cl(:,1));
PerfSOMNMI(k)=SOM(k).Perf.indice.nmi; PerfSOMNMI(k)=SOM(k).Perf.indice.nmi;
PerfSOMAdjustedRand(k)=SOM(k).Perf.indice.AdusjtedRand; PerfSOMAdjustedRand(k)=SOM(k).Perf.indice.AdusjtedRand;
PerfSOMAccu(k)=SOM(k).Perf.Performance.Accuracy; PerfSOMAccu(k)=SOM(k).Perf.Performance.Accuracy;
end end
% Apprentissage EWKmeans % Apprentissage EWKmeans
for k=1:20 for k=1:20
PerfEWKmeans(k).Perf=comparaison_partitionOM(Labels,ClEWKMeans(:,k)); PerfEWKmeans(k).Perf=comparaison_partitionOM(Labels,ClEWKMeans(:,k));
PerfEWKmeansNMI(k)=PerfEWKmeans(k).Perf.indice.nmi; PerfEWKmeansNMI(k)=PerfEWKmeans(k).Perf.indice.nmi;
PerfEWKmeansAdjustedRand(k)=PerfEWKmeans(k).Perf.indice.AdusjtedRand; PerfEWKmeansAdjustedRand(k)=PerfEWKmeans(k).Perf.indice.AdusjtedRand;
PerfEWKmeansAccu(k)=PerfEWKmeans(k).Perf.Performance.Accuracy; PerfEWKmeansAccu(k)=PerfEWKmeans(k).Perf.Performance.Accuracy;
end end
PerfEWNMI=mean(PerfEWKmeansNMI); PerfEWNMI=mean(PerfEWKmeansNMI);
PerfEWAdjustedRand=mean(PerfEWKmeansAdjustedRand); PerfEWAdjustedRand=mean(PerfEWKmeansAdjustedRand);
PerfEWAccu=mean(PerfEWKmeansAccu); PerfEWAccu=mean(PerfEWKmeansAccu);
% %
PerfEWNMI_Var=std(PerfEWKmeansNMI); PerfEWNMI_Var=std(PerfEWKmeansNMI);
PerfEWAdjustedRand_Var=std(PerfEWKmeansAdjustedRand); PerfEWAdjustedRand_Var=std(PerfEWKmeansAdjustedRand);
PerfEWAccu_Var=std(PerfEWKmeansAccu); PerfEWAccu_Var=std(PerfEWKmeansAccu);
% Apprentissage FGKmeans % Apprentissage FGKmeans
for k=1:20 for k=1:20
PerfFGKmeans(k).Perf=comparaison_partitionOM(Labels,ClFGkm(:,k)); PerfFGKmeans(k).Perf=comparaison_partitionOM(Labels,ClFGkm(:,k));
PerfFGKmeansNMI(k)=PerfFGKmeans(k).Perf.indice.nmi; PerfFGKmeansNMI(k)=PerfFGKmeans(k).Perf.indice.nmi;
PerfFGKmeansAdjustedRand(k)=PerfFGKmeans(k).Perf.indice.AdusjtedRand; PerfFGKmeansAdjustedRand(k)=PerfFGKmeans(k).Perf.indice.AdusjtedRand;
PerfFGKmeansAccu(k)=PerfFGKmeans(k).Perf.Performance.Accuracy; PerfFGKmeansAccu(k)=PerfFGKmeans(k).Perf.Performance.Accuracy;
end end
PerfFGNMI=mean(PerfFGKmeansNMI); PerfFGNMI=mean(PerfFGKmeansNMI);
PerfFGAdjustedRand=mean(PerfFGKmeansAdjustedRand); PerfFGAdjustedRand=mean(PerfFGKmeansAdjustedRand);
PerfFGAccu=mean(PerfFGKmeansAccu); PerfFGAccu=mean(PerfFGKmeansAccu);
% %
PerfFGNMI_Var=std(PerfFGKmeansNMI); PerfFGNMI_Var=std(PerfFGKmeansNMI);
PerfFGAdjustedRand_Var=std(PerfFGKmeansAdjustedRand); PerfFGAdjustedRand_Var=std(PerfFGKmeansAdjustedRand);
PerfFGAccu_Var=std(PerfFGKmeansAccu); PerfFGAccu_Var=std(PerfFGKmeansAccu);
% Create the correspondannce between the map % Create the correspondannce between the map
% Creation of Z_l data sets % Creation of Z_l data sets
% Structuraton de la base les noise en derni?res position % Structuraton de la base les noise en derni?res position
NoiseB(1).Dim=[6 8 10 12 13 17 19 22 23 24]; NoiseB(1).Dim=[6 8 10 12 13 17 19 22 23 24];
NoiseB(2).Dim=[1 4 5 6 10 11 14 15 17 24]+25; NoiseB(2).Dim=[1 4 5 6 10 11 14 15 17 24]+25;
NoiseB(3).Dim=[9 10 12 13 15 18 19 20 22 23]+50; NoiseB(3).Dim=[9 10 12 13 15 18 19 20 22 23]+50;
NoiseB(4).Dim=[1 4 8 11 12 16 19 22 23 24]+75; NoiseB(4).Dim=[1 4 8 11 12 16 19 22 23 24]+75;
Variable=1:25; Variable=1:25;
Relevance=Variables(~ismember(Variables(1:25),NoiseB(1).Dim)); Relevance=Variables(~ismember(Variables(1:25),NoiseB(1).Dim));
VarTot=[Relevance NoiseB(1).Dim]; VarTot=[Relevance NoiseB(1).Dim];
for i=1:3 for i=1:3
Variable=(1:25)+25*i; Variable=(1:25)+25*i;
Relevance=Variable(~ismember(Variable,NoiseB(i+1).Dim)); Relevance=Variable(~ismember(Variable,NoiseB(i+1).Dim));
VarTot1=[Relevance NoiseB(i+1).Dim]; VarTot1=[Relevance NoiseB(i+1).Dim];
VarTot=[VarTot VarTot1]; VarTot=[VarTot VarTot1];
end end
% VarTotF=[VarTot 101:110]; % VarTotF=[VarTot 101:110];
VarTotF=1:18; VarTotF=1:18;
Z_l=struct; Z_l=struct;
for l=1:M for l=1:M
if l==1 if l==1
Index(:,l)=sort(randsample(2126, 2126, false)); Index(:,l)=sort(randsample(2126, 2126, false));
Z_l(l).D=D( Index(:,l),:); Z_l(l).D=D( Index(:,l),:);
[sMap1 Bmus]=som_make(Z_l(l).D,'init','lininit'); %% Initialisation des param?tres de SOM [sMap1 Bmus]=som_make(Z_l(l).D,'init','lininit'); %% Initialisation des param?tres de SOM
[Z_l(l).sMap Z_l(l).bmus Z_l(l).Alpha Z_l(l).Beta ]=SS_SOM(sMap1, Z_l(l).D,'TypeAlgo','2SSOM','DimData',DimData,'DimBloc',DimBloc,'lambda',1*10+1,'eta',9*10+1,'trainlen',50); [Z_l(l).sMap Z_l(l).bmus Z_l(l).Alpha Z_l(l).Beta ]=SS_SOM(sMap1, Z_l(l).D,'TypeAlgo','2SSOM','DimData',DimData,'DimBloc',DimBloc,'lambda',1*10+1,'eta',9*10+1,'trainlen',50);
else else
Index(:,l)=sort(randsample(2126, 2126, true)); Index(:,l)=sort(randsample(2126, 2126, true));
Z_l(l).D=D( Index(:,l),:); Z_l(l).D=D( Index(:,l),:);
[sMap1 Bmus]=som_make(Z_l(l).D,'init','lininit'); %% Initialisation des param?tres de SOM [sMap1 Bmus]=som_make(Z_l(l).D,'init','lininit'); %% Initialisation des param?tres de SOM
[Z_l(l).sMap Z_l(l).bmus Z_l(l).Alpha Z_l(l).Beta ]=SS_SOM(sMap1, Z_l(l).D,'TypeAlgo','2SSOM','DimData',DimData,'DimBloc',DimBloc,'lambda',1*10+1,'eta',9*10+1,'trainlen',50); [Z_l(l).sMap Z_l(l).bmus Z_l(l).Alpha Z_l(l).Beta ]=SS_SOM(sMap1, Z_l(l).D,'TypeAlgo','2SSOM','DimData',DimData,'DimBloc',DimBloc,'lambda',1*10+1,'eta',9*10+1,'trainlen',50);
end end
end end
for l=1:M for l=1:M
SSOM_BMUS(:,l)=Z_l(l).bmus; SSOM_BMUS(:,l)=Z_l(l).bmus;
end end
EnsCluster=Index; EnsCluster=Index;
Member=struct; Member=struct;
for k=1:M for k=1:M
for kk=1:M for kk=1:M
Inter=intersect(EnsCluster(:,k),EnsCluster(:,kk)); % points belonging two bootstraps samples Inter=intersect(EnsCluster(:,k),EnsCluster(:,kk)); % points belonging two bootstraps samples
kMember=ismember(EnsCluster(:,k),Inter); % Index points in sample k kMember=ismember(EnsCluster(:,k),Inter); % Index points in sample k
kkMember=ismember(EnsCluster(:,kk),Inter); % Index points in sample kk kkMember=ismember(EnsCluster(:,kk),Inter); % Index points in sample kk
Member(k, kk).Member=kMember & kkMember; Member(k, kk).Member=kMember & kkMember;
end end
end end