available_clustering()
CMeans: Fuzzy C-means Clustering
HardCL: Hard Competitive Learning
KMeans: K-Means Clustering
NeuralGas: Neural Gas Clustering
Use available_clustering()
to get a listing of available clustering algorithms:
available_clustering()
CMeans: Fuzzy C-means Clustering
HardCL: Hard Competitive Learning
KMeans: K-Means Clustering
NeuralGas: Neural Gas Clustering
First, let’s project the dataset to 3 dimensions for easier plotting of our clustering results.
<- iris[, 1:4]
x <- decomp(x, "ICA", setup_ICA(k = 3L)) iris_ICA
Input: 150 cases x 4 features.
Centering
Whitening
Symmetric FastICA using logcosh approx. to neg-entropy function
Iteration 1 tol=0.621644
Iteration 2 tol=0.100538
Iteration 3 tol=0.027552
Iteration 4 tol=0.027034
Iteration 5 tol=0.023269
Iteration 6 tol=0.021609
Iteration 7 tol=0.019336
Iteration 8 tol=0.017831
Iteration 9 tol=0.016004
Iteration 10 tol=0.014725
Iteration 11 tol=0.013222
Iteration 12 tol=0.012145
Iteration 13 tol=0.010909
Iteration 14 tol=0.010006
Iteration 15 tol=0.008992
Iteration 16 tol=0.008237
Iteration 17 tol=0.007406
Iteration 18 tol=0.006777
Iteration 19 tol=0.006096
Iteration 20 tol=0.005572
Iteration 21 tol=0.005015
Iteration 22 tol=0.004580
Iteration 23 tol=0.004124
Iteration 24 tol=0.003763
Iteration 25 tol=0.003390
Iteration 26 tol=0.003092
Iteration 27 tol=0.002786
Iteration 28 tol=0.002539
Iteration 29 tol=0.002290
Iteration 30 tol=0.002085
Iteration 31 tol=0.001881
Iteration 32 tol=0.001712
Iteration 33 tol=0.001545
Iteration 34 tol=0.001406
Iteration 35 tol=0.001269
Iteration 36 tol=0.001154
Iteration 37 tol=0.001042
Iteration 38 tol=0.000947
Iteration 39 tol=0.000856
Iteration 40 tol=0.000778
Iteration 41 tol=0.000703
Iteration 42 tol=0.000638
Iteration 43 tol=0.000577
Iteration 44 tol=0.000524
Iteration 45 tol=0.000474
Iteration 46 tol=0.000430
Iteration 47 tol=0.000389
Iteration 48 tol=0.000353
Iteration 49 tol=0.000319
Iteration 50 tol=0.000290
Iteration 51 tol=0.000262
Iteration 52 tol=0.000238
Iteration 53 tol=0.000215
Iteration 54 tol=0.000195
Iteration 55 tol=0.000177
Iteration 56 tol=0.000160
Iteration 57 tol=0.000145
Iteration 58 tol=0.000132
Iteration 59 tol=0.000119
Iteration 60 tol=0.000108
Iteration 61 tol=0.000098
<- cluster(
iris_KMeans
x,algorithm = "KMeans",
parameters = setup_KMeans(k = 3L)
)
Input: 150 cases x 4 features.
iris_KMeans
.:KMeans Clustering
clust: (S4 object of class: 'kcca')
k: <int> 3
clusters: <int> 3, 3, 3, 3...
parameters:
KMeans ClusteringParameters
k: <int> 3
dist: <chr> euclidean
draw_3Dscatter(
$transformed,
iris_ICAgroup = iris_KMeans$clusters,
main = "KMeans on iris",
xlab = "1st ICA component",
ylab = "2nd ICA component",
zlab = "3rd ICA component"
)
<- cluster(
iris_CMeans
x,algorithm = "CMeans",
parameters = setup_CMeans(k = 3L)
)
Input: 150 cases x 4 features.
Iteration: 1, Error: 1.1027892503
Iteration: 2, Error: 0.4959685144
Iteration: 3, Error: 0.4080695197
Iteration: 4, Error: 0.4048884272
Iteration: 5, Error: 0.4039867977
Iteration: 6, Error: 0.4036306259
Iteration: 7, Error: 0.4034808602
Iteration: 8, Error: 0.4034174530
Iteration: 9, Error: 0.4033907078
Iteration: 10, Error: 0.4033794751
Iteration: 11, Error: 0.4033747727
Iteration: 12, Error: 0.4033728085
Iteration: 13, Error: 0.4033719892
Iteration: 14, Error: 0.4033716478
Iteration: 15, Error: 0.4033715056
Iteration: 16, Error: 0.4033714464
Iteration: 17, Error: 0.4033714218
Iteration: 18, Error: 0.4033714115
Iteration: 19 converged, Error: 0.4033714072
iris_CMeans
.:CMeans Clustering
clust: object of class: fclust
k: <int> 3
clusters: <int> 2, 2, 2, 2...
parameters:
CMeans ClusteringParameters
k: <int> 3
max_iter: <int> 100
dist: <chr> euclidean
method: <chr> cmeans
m: <nmr> 2.00
rate_par: <NUL> NULL
weights: <nmr> 1.00
control: (empty list)
draw_3Dscatter(
$transformed,
iris_ICAgroup = iris_CMeans$clusters,
main = "CMeans on iris",
xlab = "1st ICA component",
ylab = "2nd ICA component",
zlab = "3rd ICA component"
)
<- cluster(
iris_HardCL
x,algorithm = "HardCL",
parameters = setup_HardCL(k = 3L)
)
Input: 150 cases x 4 features.
iris_HardCL
.:HardCL Clustering
clust: (S4 object of class: 'kcca')
k: <int> 3
clusters: <int> 1, 1, 1, 1...
parameters:
HardCL ClusteringParameters
k: <int> 3
dist: <chr> euclidean
draw_3Dscatter(
$transformed,
iris_ICAgroup = iris_HardCL$clusters,
main = "HardCL on iris",
xlab = "1st ICA component",
ylab = "2nd ICA component",
zlab = "3rd ICA component"
)
<- cluster(
iris_NeuralGas
x,algorithm = "NeuralGas",
parameters = setup_NeuralGas(k = 3L)
)
Input: 150 cases x 4 features.
iris_NeuralGas
.:NeuralGas Clustering
clust: (S4 object of class: 'kcca')
k: <int> 3
clusters: <int> 3, 3, 3, 3...
parameters:
NeuralGas ClusteringParameters
k: <int> 3
dist: <chr> euclidean
draw_3Dscatter(
$transformed,
iris_ICAgroup = iris_NeuralGas$clusters,
main = "NeuralGas on iris",
xlab = "1st ICA component",
ylab = "2nd ICA component",
zlab = "3rd ICA component"
)