Matlab program of fuzzy c means final-edition

Post on 14-Jun-2015

11196 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

DESCRIPTION

This slide is aim to introduce a p

Transcript

C-means inmatlab

K-Means

Basic K-means algorithm

Select K points as initial centroids.Repeat Form K clusters by assigning each point to its closest centroid. Recompute the centroid of each cluster.Until Centroids do not change.

Basic Fuzzy C-Means algorithmAllow an object to belong to a set with a degree of membership between 0 to 1.

Fuzzy Clustering Fuzzy C-Means

Select an initial fuzzy pseudo-partition, i.e., assign values to all the Wij.RepeatCompute the centroid of each cluster using the fuzzy pseudo-partition.Recompute the fuzzy pseudo-partition, i.e. the Wij.Until The centroids do not change.

Lack of programs of high quality

Single distance function

Poor effect

Nonsupport of sparse data

Matlab R2009b

Fuzzy C-means

Some Distance Functions

Variable Neighborhood Search

Support of sparse dataand initialization Method

Run_fcm.m

Loaddata_sparse.m

Loaddata_dense.m

Initialize.m

Initcenter.m

Iterate.m

Run_vns.m

To deal with input parameters and Call other functions

To load data of sparse or dense

Both of the files should be ASCII data

To preprocess data based on different distance functions for further analysis

To initialize centroids by random or given to start the algorithm The core of the Algorithm including updating membership matrix and centroids and computing objective function

To proceed VNS method

Run_fcm

Loaddata_sparse Loaddata_sparse

Initialize

Initcenter

Iterate

Dismat0Distance_euc

Distance_cos Output

Run_vns Output

Structure of the program

Deal with parameter

S

To attain a satisfied result, many input parameters are necessary. Such as

Distance function File style

Stop condition

Exponent

Max iterationThreshold Center type

The number of class Use VNS method or not

Although there times when we do not specify every parameters, since part of them could be defaults

function [matrixu, centroid, niter, obj,vnsobj] = run_fcm(nclass,fname,filesty, )varargin

internal.stats.getargs

[matrixu,centroid,niter,obj]=run_fcm(6,'la12.mat','sparse','expo',2,'distance','cosine','vns','on');

Read and store sparse data

With the help of matlab function--------sparse()If we initialize a large matrix to store the whole data, that would be …Sparse data can not be Loaded directlyFopen() + Fgetl() + Strtok() + Spalloc()

Out of memory ! My solution is to cut them into pieces and then make them up.

Sparse data calculation

When data stored as sparse matrix, what kind of calculation could it do?

Basic operation between row vectors and another numerical value

Dot product between row vectors and another sparse vector

Ergodic of column vectors with zeros displayed

Sum-of-squares of row vectors

Logarithm of row vectors

Variable Neighborhood Search

THANKS

THANKS

Chen LiuArcherlaus@gmail.com

top related