Examples of joint grid discretization

Jiandong Wang, Sajal Kumar, and Joe Song

Updated: 2020-09-13; 2020-08-01; Created: 2020-03-17

Example 1. Nonlinear curves using k-means clustering with a fixed number of clusters

require(GridOnClusters)
#> Loading required package: GridOnClusters
x = rnorm(50)
y = sin(x)
z = cos(x)
data = cbind(x, y, z)
res = discretize.jointly(data, k=3) # using a specified k
plotGOCpatterns(data, res)
Example 1. Nonlinear curves using k-means clustering with a fixed number of clusters.Example 1. Nonlinear curves using k-means clustering with a fixed number of clusters.Example 1. Nonlinear curves using k-means clustering with a fixed number of clusters.Example 1. Nonlinear curves using k-means clustering with a fixed number of clusters.Example 1. Nonlinear curves using k-means clustering with a fixed number of clusters.Example 1. Nonlinear curves using k-means clustering with a fixed number of clusters.

Example 1. Nonlinear curves using k-means clustering with a fixed number of clusters.

Example 2. Nonlinear curves and patterns using k-means clustering with a range for the number of clusters

 x = rnorm(100)
 y = log1p(abs(x))
 z = ifelse(x >= -0.5 & x <= 0.5, 0, 1) + rnorm(100, 0, 0.1)
 data = cbind(x, y, z)
 res = discretize.jointly(data, k=c(2:3)) # using a range of k
 plotGOCpatterns(data, res)
Example 2. Using a range for the number of k-means clustersExample 2. Using a range for the number of k-means clustersExample 2. Using a range for the number of k-means clustersExample 2. Using a range for the number of k-means clustersExample 2. Using a range for the number of k-means clustersExample 2. Using a range for the number of k-means clusters

Example 2. Using a range for the number of k-means clusters

Example 3. Using the partition around medoids clustering method

 # using a clustering method other than k-means
 x = rnorm(100)
 y = log1p(abs(x))
 z = sin(x)
 data = cbind(x, y, z)

 # pre-cluster the data using partition around medoids (PAM)
 cluster_label = cluster::pam(x=data, diss = FALSE, metric = "euclidean", k = 4)$clustering
 res = discretize.jointly(data, cluster_label = cluster_label)
 plotGOCpatterns(data, res)
Example 3. Using the partition around medoids clustering method.Example 3. Using the partition around medoids clustering method.Example 3. Using the partition around medoids clustering method.Example 3. Using the partition around medoids clustering method.Example 3. Using the partition around medoids clustering method.Example 3. Using the partition around medoids clustering method.

Example 3. Using the partition around medoids clustering method.