fuzzy.CM: Fuzzy C-Means

Description Usage Arguments Details Value Slots References Examples

View source: R/fuzzy.CM.R

Description

Fuzzy C-Means clustering Algorithm (Bezdek, 1984)

Usage

1
2
fuzzy.CM(X, K, m, max.iteration, threshold, member.init, RandomNumber = 0,
  print.result = 0)

Arguments

X

dataset (matrix/data frame)

K

number of cluster

m

fuzzyfier

max.iteration

maximum iteration for convergence

threshold

convergence criteria

member.init

membership object or matrix that will be used for initialized

RandomNumber

random number for start initializing

print.result

print result (9/1)

Details

This function perform Fuzzy C-Means algorithm by Bezdek (1984). Fuzzy C-Means is one of fuzzy clustering methods to clustering dataset become K cluster. Number of cluster (K) must be greater than 1. To control the overlaping or fuzziness of clustering, parameter m must be specified. Maximum iteration and threshold is specific number for convergencing the cluster. Random Number is number that will be used for seeding to firstly generate fuzzy membership matrix.

Clustering will produce fuzzy membership matrix (U) and fuzzy cluster centroid (V). The greatest value of membership on data point will determine cluster label. Centroid or cluster center can be use to interpret the cluster. Both membership and centroid produced by calculating mathematical distance. Fuzzy C-Means calculate distance with Euclideans norm.

Value

Fuzzy Clustering object

Slots

centroid

centroid matrix

distance

distance matrix

func.obj

function objective

call.func

called function

fuzzyfier

fuzzyness parameter

method.fuzzy

method of fuzzy clustering used

member

membership matrix

hard.label

hard.label

References

Balasko, B., Abonyi, J., & Feil, B. (2002). Fuzzy Clustering and Data Analysis Toolbox: For Use with Matlab. Veszprem, Hungary.

Bezdek, J. C., Ehrlich, R., & Full, W. (1984). FCM: The Fuzzy C-Means Clustering Algorithm. Computers and Geosciences Vol 10, 191-203

Examples

1
fuzzy.CM(iris[,1:4],K=3,m=2,max.iteration=100,threshold=1e-5,RandomNumber=1234)

Example output

Membership initialiazed randomly


 iteration:	 1
 iteration:	 2
 iteration:	 3
 iteration:	 4
 iteration:	 5
 iteration:	 6
 iteration:	 7
 iteration:	 8
 iteration:	 9
 iteration:	 10
 iteration:	 11
 iteration:	 12
 iteration:	 13
 iteration:	 14
 iteration:	 15
 iteration:	 16
 iteration:	 17
 iteration:	 18
 iteration:	 19
 iteration:	 20
 iteration:	 21
 iteration:	 22
 iteration:	 23
 iteration:	 24
 iteration:	 25
 iteration:	 26
 iteration:	 27
 iteration:	 28
Finish :)
Function call: fuzzy.CM(X = iris[, 1:4], K = 3, m = 2, max.iteration = 100,  Function call:     threshold = 1e-05, RandomNumber = 1234)
Fuzzy C-Means
Function objective: 60.5057106345492
Membership & Label Matrix:

|        | Cluster 1| Cluster 2| Cluster 3| Label|
|:-------|---------:|---------:|---------:|-----:|
|Obs 1   |     0.002|     0.997|     0.001|     2|
|Obs 2   |     0.017|     0.976|     0.007|     2|
|Obs 3   |     0.014|     0.980|     0.006|     2|
|Obs 4   |     0.022|     0.967|     0.010|     2|
|Obs 5   |     0.004|     0.994|     0.002|     2|
|Obs 6   |     0.045|     0.935|     0.021|     2|
|Obs 7   |     0.014|     0.979|     0.007|     2|
|Obs 8   |     0.000|     1.000|     0.000|     2|
|Obs 9   |     0.048|     0.930|     0.022|     2|
|Obs 10  |     0.012|     0.983|     0.005|     2|
|Obs 11  |     0.022|     0.968|     0.010|     2|
|Obs 12  |     0.005|     0.992|     0.002|     2|
|Obs 13  |     0.020|     0.971|     0.009|     2|
|Obs 14  |     0.052|     0.923|     0.025|     2|
|Obs 15  |     0.073|     0.890|     0.038|     2|
|Obs 16  |     0.104|     0.841|     0.054|     2|
|Obs 17  |     0.036|     0.947|     0.017|     2|
|Obs 18  |     0.002|     0.997|     0.001|     2|
|Obs 19  |     0.066|     0.904|     0.030|     2|
|Obs 20  |     0.014|     0.979|     0.007|     2|
|Obs 21  |     0.022|     0.969|     0.010|     2|
|Obs 22  |     0.010|     0.985|     0.005|     2|
|Obs 23  |     0.028|     0.959|     0.014|     2|
|Obs 24  |     0.014|     0.979|     0.006|     2|
|Obs 25  |     0.023|     0.967|     0.010|     2|
|Obs 26  |     0.018|     0.974|     0.008|     2|
|Obs 27  |     0.004|     0.995|     0.002|     2|
|Obs 28  |     0.005|     0.993|     0.002|     2|
|Obs 29  |     0.004|     0.994|     0.002|     2|
|Obs 30  |     0.014|     0.980|     0.006|     2|
|Obs 31  |     0.015|     0.979|     0.006|     2|
|Obs 32  |     0.018|     0.974|     0.008|     2|
|Obs 33  |     0.041|     0.939|     0.020|     2|
|Obs 34  |     0.063|     0.904|     0.032|     2|
|Obs 35  |     0.010|     0.985|     0.005|     2|
|Obs 36  |     0.010|     0.985|     0.005|     2|
|Obs 37  |     0.024|     0.964|     0.012|     2|
|Obs 38  |     0.006|     0.991|     0.003|     2|
|Obs 39  |     0.041|     0.940|     0.019|     2|
|Obs 40  |     0.001|     0.998|     0.001|     2|
|Obs 41  |     0.004|     0.995|     0.002|     2|
|Obs 42  |     0.102|     0.851|     0.047|     2|
|Obs 43  |     0.032|     0.953|     0.015|     2|
|Obs 44  |     0.014|     0.979|     0.006|     2|
|Obs 45  |     0.038|     0.945|     0.017|     2|
|Obs 46  |     0.019|     0.972|     0.009|     2|
|Obs 47  |     0.016|     0.977|     0.007|     2|
|Obs 48  |     0.018|     0.974|     0.008|     2|
|Obs 49  |     0.016|     0.977|     0.007|     2|
|Obs 50  |     0.002|     0.997|     0.001|     2|
|Obs 51  |     0.454|     0.045|     0.501|     3|
|Obs 52  |     0.764|     0.029|     0.207|     1|
|Obs 53  |     0.369|     0.031|     0.600|     3|
|Obs 54  |     0.870|     0.049|     0.080|     1|
|Obs 55  |     0.759|     0.024|     0.217|     1|
|Obs 56  |     0.974|     0.006|     0.020|     1|
|Obs 57  |     0.673|     0.030|     0.297|     1|
|Obs 58  |     0.583|     0.285|     0.132|     1|
|Obs 59  |     0.721|     0.031|     0.248|     1|
|Obs 60  |     0.831|     0.075|     0.095|     1|
|Obs 61  |     0.637|     0.218|     0.145|     1|
|Obs 62  |     0.962|     0.009|     0.029|     1|
|Obs 63  |     0.843|     0.056|     0.101|     1|
|Obs 64  |     0.900|     0.012|     0.088|     1|
|Obs 65  |     0.816|     0.092|     0.092|     1|
|Obs 66  |     0.690|     0.042|     0.268|     1|
|Obs 67  |     0.933|     0.014|     0.053|     1|
|Obs 68  |     0.926|     0.026|     0.048|     1|
|Obs 69  |     0.835|     0.027|     0.137|     1|
|Obs 70  |     0.878|     0.052|     0.071|     1|
|Obs 71  |     0.722|     0.028|     0.251|     1|
|Obs 72  |     0.934|     0.019|     0.046|     1|
|Obs 73  |     0.705|     0.024|     0.271|     1|
|Obs 74  |     0.903|     0.014|     0.083|     1|
|Obs 75  |     0.876|     0.023|     0.101|     1|
|Obs 76  |     0.755|     0.034|     0.211|     1|
|Obs 77  |     0.524|     0.034|     0.443|     1|
|Obs 78  |     0.306|     0.021|     0.672|     3|
|Obs 79  |     0.969|     0.005|     0.026|     1|
|Obs 80  |     0.767|     0.128|     0.105|     1|
|Obs 81  |     0.832|     0.078|     0.090|     1|
|Obs 82  |     0.795|     0.104|     0.101|     1|
|Obs 83  |     0.919|     0.031|     0.050|     1|
|Obs 84  |     0.656|     0.024|     0.320|     1|
|Obs 85  |     0.891|     0.026|     0.082|     1|
|Obs 86  |     0.797|     0.032|     0.171|     1|
|Obs 87  |     0.555|     0.033|     0.411|     1|
|Obs 88  |     0.858|     0.027|     0.115|     1|
|Obs 89  |     0.929|     0.024|     0.047|     1|
|Obs 90  |     0.899|     0.038|     0.062|     1|
|Obs 91  |     0.931|     0.020|     0.049|     1|
|Obs 92  |     0.916|     0.012|     0.073|     1|
|Obs 93  |     0.936|     0.023|     0.042|     1|
|Obs 94  |     0.598|     0.269|     0.133|     1|
|Obs 95  |     0.959|     0.013|     0.028|     1|
|Obs 96  |     0.946|     0.017|     0.038|     1|
|Obs 97  |     0.967|     0.010|     0.023|     1|
|Obs 98  |     0.944|     0.011|     0.045|     1|
|Obs 99  |     0.520|     0.355|     0.125|     1|
|Obs 100 |     0.961|     0.013|     0.027|     1|
|Obs 101 |     0.121|     0.019|     0.860|     3|
|Obs 102 |     0.616|     0.029|     0.355|     1|
|Obs 103 |     0.038|     0.006|     0.956|     3|
|Obs 104 |     0.142|     0.013|     0.846|     3|
|Obs 105 |     0.038|     0.005|     0.958|     3|
|Obs 106 |     0.153|     0.035|     0.812|     3|
|Obs 107 |     0.760|     0.073|     0.167|     1|
|Obs 108 |     0.115|     0.022|     0.863|     3|
|Obs 109 |     0.117|     0.014|     0.869|     3|
|Obs 110 |     0.115|     0.024|     0.861|     3|
|Obs 111 |     0.210|     0.017|     0.773|     3|
|Obs 112 |     0.223|     0.016|     0.761|     3|
|Obs 113 |     0.010|     0.001|     0.989|     3|
|Obs 114 |     0.660|     0.034|     0.306|     1|
|Obs 115 |     0.461|     0.038|     0.501|     3|
|Obs 116 |     0.136|     0.014|     0.850|     3|
|Obs 117 |     0.080|     0.007|     0.913|     3|
|Obs 118 |     0.186|     0.051|     0.764|     3|
|Obs 119 |     0.193|     0.049|     0.758|     3|
|Obs 120 |     0.711|     0.032|     0.257|     1|
|Obs 121 |     0.026|     0.004|     0.970|     3|
|Obs 122 |     0.707|     0.034|     0.259|     1|
|Obs 123 |     0.175|     0.042|     0.783|     3|
|Obs 124 |     0.596|     0.023|     0.381|     1|
|Obs 125 |     0.022|     0.003|     0.975|     3|
|Obs 126 |     0.075|     0.013|     0.912|     3|
|Obs 127 |     0.708|     0.021|     0.271|     1|
|Obs 128 |     0.647|     0.023|     0.330|     1|
|Obs 129 |     0.083|     0.008|     0.909|     3|
|Obs 130 |     0.095|     0.014|     0.891|     3|
|Obs 131 |     0.107|     0.020|     0.873|     3|
|Obs 132 |     0.189|     0.051|     0.760|     3|
|Obs 133 |     0.085|     0.009|     0.906|     3|
|Obs 134 |     0.540|     0.023|     0.436|     1|
|Obs 135 |     0.393|     0.031|     0.576|     3|
|Obs 136 |     0.132|     0.029|     0.840|     3|
|Obs 137 |     0.129|     0.017|     0.854|     3|
|Obs 138 |     0.110|     0.010|     0.880|     3|
|Obs 139 |     0.750|     0.022|     0.228|     1|
|Obs 140 |     0.029|     0.003|     0.968|     3|
|Obs 141 |     0.038|     0.005|     0.957|     3|
|Obs 142 |     0.129|     0.015|     0.855|     3|
|Obs 143 |     0.616|     0.029|     0.355|     1|
|Obs 144 |     0.034|     0.005|     0.961|     3|
|Obs 145 |     0.063|     0.010|     0.927|     3|
|Obs 146 |     0.106|     0.011|     0.882|     3|
|Obs 147 |     0.508|     0.026|     0.467|     1|
|Obs 148 |     0.156|     0.012|     0.831|     3|
|Obs 149 |     0.189|     0.022|     0.789|     3|
|Obs 150 |     0.582|     0.027|     0.391|     1|

Centroid:

|          | Sepal.Length| Sepal.Width| Petal.Length| Petal.Width|
|:---------|------------:|-----------:|------------:|-----------:|
|Cluster 1 |        5.889|       2.761|        4.364|       1.397|
|Cluster 2 |        5.004|       3.414|        1.483|       0.254|
|Cluster 3 |        6.775|       3.052|        5.647|       2.054|

advclust documentation built on May 30, 2017, 1:42 a.m.