Learn R Programming

TML (version 2.3.0)

TKmeans: K-means clustering over the tropical projective torus

Description

This function performs k-means clustering over the tropical projective torus

Usage

TKmeans(A, C, M)

Value

list with matrix of observation classified by centroid; matrix of centroid coordinates; number of iterations used

Arguments

A

matrix of points defining a tropical polytope; rows are the tropical points

C

number of clusters

M

maximum number of iterations of algorithm to find cluster centroids

Author

David Barnhill david.barnhill@nps.edu

References

David Barnhill, Ruriko Yoshida (2023). Clustering Methods Over the Tropically Convex Sets.

Examples

Run this code
P <-Sim_points
C<-3
M<-10
res<-TKmeans(P,C,M)
try<-res[[1]]
cen<-res[[2]]
plot(try[,2],try[,3],col=try[,4],asp=1)
plot(try[,2],try[,3],col=try[,4],asp=1,xlab='x2',ylab='x3')
points(cen[,2],cen[,3],col=c('purple','hotpink','orange'),pch=19)

Run the code above in your browser using DataLab