Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
168 CHAPTER 7 Clustering if(sum(m_tot==m_best)<.1*n_theta) m_best=1; theta_best=sum(theta_tot.*(m_tot==1))/sum(m_tot==1); end Step 2. Run the BSAS algorithm for order=randperm(N); = best : [bel, repre]=BSAS(X1,theta_best,q,order); Plot the results (see Figure 7.3(b)), typing figure(11), hold on figure(11), plot(X1(1,bel==1),X1(2,bel==1),'r.',... X1(1,bel==2),X1(2,bel==2),'g*',X1(1,bel==3),X1(2,bel==3),'bo',... X1(1,bel==4),X1(2,bel==4),'cx',X1(1,bel==5),X1(2,bel==5),'md',... X1(1,bel==6),X1(2,bel==6),'yp',X1(1,bel==7),X1(2,bel==7),'ks') figure(11), plot(repre(1,:),repre(2,:),'k+') Step 3. To run the reassignment procedure, type [bel,new_repre]=reassign(X1,repre,order); Plot the results working as in the previous step (see Figure 7.3(c)). Compare the results obtained by the current and previous steps, observing the influence of reassignment on the results. Exercise 7.4.1 Generate and plot a data set, X 2 , that consists of 300 2-dimensional points stemming from the normal distri- bution with mean m 1 = [0, 0] T and covariance matrix equal to the 2×2 identity matrix. Repeat step 1 of Example 7.4.2 and draw conclusions. Observe that X 2 contains no clusters. 7.5 COST FUNCTION OPTIMIZATION CLUSTERING ALGORITHMS In this section, each cluster, C j , in a clustering is parameterized by a vector of parameters j . The aim is to identify the values of these parameter vectors, which characterize the clustering structure of X in an optimal sense. This is carried out via the optimization of appropriately defined functions. 7.5.1 Hard Clustering Algorithms In the algorithms of this category, it is assumed that each data vector belongs exclusively to a single cluster.