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
Centering
colstandard
Whitening
Symmetric FastICA using logcosh approx. to neg-entropy function
Iteration 1 tol=0.021070
Iteration 2 tol=0.001818
Iteration 3 tol=0.001090
Iteration 4 tol=0.000584
Iteration 5 tol=0.000273
Iteration 6 tol=0.000114
Iteration 7 tol=0.000045
<- cluster(
iris_KMeans
x,algorithm = "KMeans",
parameters = setup_KMeans(k = 3L)
)
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)
)
Iteration: 1, Error: 0.9529189884
Iteration: 2, Error: 0.4350755624
Iteration: 3, Error: 0.4057977923
Iteration: 4, Error: 0.4041266271
Iteration: 5, Error: 0.4036691859
Iteration: 6, Error: 0.4034953360
Iteration: 7, Error: 0.4034233983
Iteration: 8, Error: 0.4033931930
Iteration: 9, Error: 0.4033805153
Iteration: 10, Error: 0.4033752075
Iteration: 11, Error: 0.4033729899
Iteration: 12, Error: 0.4033720648
Iteration: 13, Error: 0.4033716793
Iteration: 14, Error: 0.4033715187
Iteration: 15, Error: 0.4033714518
Iteration: 16, Error: 0.4033714240
Iteration: 17, Error: 0.4033714124
Iteration: 18 converged, Error: 0.4033714076
iris_CMeans
.:CMeans Clustering
clust: object of class: fclust
k: <int> 3
clusters: <int> 1, 1, 1, 1...
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)
)
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)
)
iris_NeuralGas
.:NeuralGas Clustering
clust: (S4 object of class: 'kcca')
k: <int> 3
clusters: <int> 1, 1, 1, 1...
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"
)