GithubHelp home page GithubHelp logo

bhaskarganesh / fcm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gyaikhom/fcm

0.0 1.0 0.0 963 KB

Implements the Fuzzy c-Means Algorithm

License: MIT License

Makefile 1.52% Roff 33.39% C 65.09%

fcm's Introduction

Fuzzy c-Means Algorithm

A clustering algorithm organises items into groups based on a similarity criteria. The Fuzzy c-Means algorithm is a clustering algorithm where each item may belong to more than one group (hence the word fuzzy), where the degree of membership for each item is given by a probability distribution over the clusters.

In this project, we Implement the Fuzzy c-Means Algorithm. For further details, please visit my homepage, or view the CWEB generated documentationfcm.pdf.

There are two separate programs in this project. They are:

Program fcm.c

This is an implementation of the Fuzzy C-Means Algorithm. It expects an input data file in the following format.

<number of data-points>
<number of clusters>
<number of dimensions>
<fuzzyness coefficient>
<termination criterion>
<data points> ...

For example, the following is a valid input file:

10 3 2
2.0 0.00005
897 802 765 992 1 521 220 380 729 969
184 887 104 641 909 378 724 582 387 583 

This has 10 data-points, each with 2 dimensions. The FCM program will try to cluster these 10 points into 3 clusters. The fuzzyness coefficient is 2.0 and the termination criterion (accuracy of the clustering) is 0.00005. For each of the 10 points, there are two values for each of the two dimensions. Hence, there are 20 data points listed.

Program gen.c

Since it is tedious to generate the data points by hand, the gen program generates the data points automatically. In order to use this program, provide a filename which will be used for storing the input data for running fcm later.

Usage

An example run of the above two programs will be (in sequence)

$ cd fcm
$ make
$ ./gen input.dat
$ ./fcm input.dat

If the number of dimensions is 2 (points on a plane), and if you have access to gnuplot, then the graph plotting the clusters, with different colours for each of the clusters, can be generated by processing the file gnuplot.script with gnuplot. An example run will be

$ gnuplot gnuplot.script

This will generate an image file named cluster_plot.png.

fcm's People

Contributors

gyaikhom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.