fuzzy_icmeans.Rd
Performs fuzzy c-means clustering on interval data, allowing for soft clustering of data points into multiple clusters.
fuzzy_icmeans(
x,
centers,
m = 2,
nstart = 2,
distance = "euclid",
trace = FALSE,
iter.max = 40
)
A 3D interval array representing the data to be clustered.
Either the number of clusters or a set of pre-initialized cluster centers. If a number is provided, it specifies how many clusters to create.
A number greater than 1 that controls the degree of fuzziness in the clustering process (default is 2).
Number of times to run the clustering algorithm with different starting values to find the best solution (default is 2).
A string specifying the distance metric to use, either 'euclid' for Euclidean distance or 'hausdorff' for Hausdorff distance (default is 'euclid').
Logical, if `TRUE`, tracing information on the progress of the algorithm is displayed (default is `FALSE`).
Maximum number of iterations allowed for the clustering algorithm (default is 40).
A list of clustering results, including: - `cluster`: The membership matrix indicating the degree of belonging of each data point to each cluster. - `centers`: The final cluster centers. - `totss`: Total sum of squares. - `withinss`: Within-cluster sum of squares by cluster. - `tot.withinss`: Total within-cluster sum of squares. - `betweenss`: Between-cluster sum of squares. - `size`: Sizes of each cluster. - `iter`: Number of iterations run by the algorithm. - `overlaps`: The average overlap among clusters.
fuzzy_icmeans(iaggregate(iris, col = 5), 2)
#> Fuzzy Icmeans clustering with 2 clusters of sizes: 3, 2
#>
#> Cluster centers:
#> , , Sepal.Length
#>
#> min max
#> 1 4.306242 5.813386
#> 2 4.900000 7.481546
#>
#> , , Sepal.Width
#>
#> min max
#> 1 2.297079 4.389997
#> 2 2.107010 3.614020
#>
#> , , Petal.Length
#>
#> min max
#> 1 1.022309 1.935094
#> 2 3.802576 6.063092
#>
#> , , Petal.Width
#>
#> min max
#> 1 0.1097637 0.6131852
#> 2 1.2140204 2.1745356
#>
#> Available components:
#> [1] "inter" "class"
#>
#> Clustering vector:
#> [,1] [,2]
#> [1,] 1.00 0.00
#> [2,] 0.10 0.90
#> [3,] 0.03 0.97
#>
#> Within-cluster sum of squares by cluster:
#> [1] 0.2300097 3.1162359
#> (Between_SS / Total_SS = 95.1%)
#> Available components:
#> [1] "cluster" "centers" "totss" "withinss" "tot.withinss"
#> [6] "betweenss" "size" "iter" "overlaps"
fuzzy_icmeans(iaggregate(iris, col = 5), iaggregate(iris, col = 5))
#> Fuzzy Icmeans clustering with 3 clusters of sizes: 1, 1, 1
#>
#> Cluster centers:
#> , , Sepal.Length
#>
#> min max
#> 1 4.3 5.8
#> 2 4.9 7.0
#> 3 4.9 7.9
#>
#> , , Sepal.Width
#>
#> min max
#> 1 2.3 4.4
#> 2 2.0 3.4
#> 3 2.2 3.8
#>
#> , , Petal.Length
#>
#> min max
#> 1 1.0 1.9
#> 2 3.0 5.1
#> 3 4.5 6.9
#>
#> , , Petal.Width
#>
#> min max
#> 1 0.1 0.6
#> 2 1.0 1.8
#> 3 1.4 2.5
#>
#> Available components:
#> [1] "inter" "class"
#>
#> Clustering vector:
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>
#> Within-cluster sum of squares by cluster:
#> [1] 0 0 0
#> (Between_SS / Total_SS = 100.0%)
#> Available components:
#> [1] "cluster" "centers" "totss" "withinss" "tot.withinss"
#> [6] "betweenss" "size" "iter" "overlaps"