|
TPCCLIB
|
Header file for library libtpcfcmc. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include "tpcextensions.h"Go to the source code of this file.
Data Structures | |
| struct | FCMC |
Functions | |
| void | fcmcInit (FCMC *fcmc) |
| void | fcmcFree (FCMC *fcmc) |
| int | fcmcAllocate (FCMC *fcmc, unsigned int sampleNr, unsigned int dimNr, unsigned int clusterNr) |
| void | fcmcPrint (FCMC *fcmc, FILE *fp) |
| int | fcmcClusterInitialize (FCMC *fcmc, const int cinit, int verbose) |
| int | fcmclustering (FCMC *fcmc, const int cinit, int verbose) |
Header file for library libtpcfcmc.
Fuzzy C means Clustering algorithm.
Definition in file tpcfcmc.h.
|
extern |
Free memory allocated for FCMC data. All contents are destroyed.
| fcmc | Pointer to FCMC struct; any pre-existing contents are deleted. |
| sampleNr | Number of data samples. |
| dimNr | Number of dimensions for each sample. |
| clusterNr | Number of clusters. |
Definition at line 69 of file fcmc.c.
|
extern |
Initialize cluster centres. You probably want to replace this function with one tailored for your data; this works only if sample numbers are reasonably well balanced between clusters.
Reference: Yedla M, Pathakota SR, Srinivasa TM. Enhancing K-means clustering algorithm with improved initial center. Int J Comp Sci Inform Technol. 2010;1(2): 121-125.
| fcmc | Pointer to FCMC struct. |
| cinit | Initialization method:
|
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 220 of file fcmc.c.
Referenced by fcmclustering().
|
extern |
Free memory allocated for FCMC data. All contents are destroyed.
| fcmc | Pointer to FCMC struct; |
Definition at line 43 of file fcmc.c.
Referenced by fcmcAllocate().
|
extern |
Initiate the FCMC struct before any use.
| fcmc | Pointer to FCMC struct. |
Definition at line 21 of file fcmc.c.
Referenced by fcmcFree().
|
extern |
Fuzzy C means clustering. Works, but code optimization still needed.
The following parameters in FCMC struct can be changed before calling this function:
This code and its tests are based on C code in https://github.com/JRC1995/Fuzzy-C-Mean.
References:
| fcmc | Pointer to filled FCMC struct. |
| cinit | Initialize cluster centres locally: 0=no (user has already initialized those), 1=yes (using fcmcClusterInitialize() with sample distances to mean), 2=yes (using fcmcClusterInitialize() with sample distances to zero). |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 326 of file fcmc.c.
|
extern |
Print the contents of FCMC data struct into specified file pointer.
| fcmc | Pointer to FCMC struct. |
| fp | File pointer, usually stdout. |
Definition at line 132 of file fcmc.c.
Referenced by fcmclustering().