Skip to contents

Delegates grouping to morie_geron_agglomerative, scores it with morie_geron_silhouette, and delegates compression to morie_geron_autoencoder (both from geron_ml_native.R / this shard).

Usage

morie_geron_unsupervised_learning(
  X,
  n_clusters = 2,
  bottleneck = 1,
  linkage = "average"
)

Arguments

X

Unlabeled data (n, d), n >= 2.

n_clusters

Groups to look for.

bottleneck

Code width for compression.

linkage

Linkage rule.

Value

list with labels, silhouette, silhouette_samples, codes, reconstruction, recon_error, explained_variance_ratio, merge_heights, estimate, n, method.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_unsupervised_learning(V)
#> $labels
#> [1] 0 0 0 0 1 1 1 1
#> 
#> $silhouette
#> [1] 0.5397787
#> 
#> $silhouette_samples
#> [1] 0.6363636 0.7037037 0.6190476 0.2000000 0.2000000 0.6190476 0.7037037
#> [8] 0.6363636
#> 
#> $codes
#>      [,1]
#> [1,] -3.5
#> [2,] -2.5
#> [3,] -1.5
#> [4,] -0.5
#> [5,]  0.5
#> [6,]  1.5
#> [7,]  2.5
#> [8,]  3.5
#> 
#> $reconstruction
#>      [,1]
#> [1,]    1
#> [2,]    2
#> [3,]    3
#> [4,]    4
#> [5,]    5
#> [6,]    6
#> [7,]    7
#> [8,]    8
#> 
#> $recon_error
#> [1] 0
#> 
#> $explained_variance_ratio
#> [1] 1
#> 
#> $merge_heights
#> [1] 1 1 1 1 2 2
#> 
#> $estimate
#> [1] 0.5397787
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Unsupervised structure: agglomerative grouping (hmagc) + silhouette (hmsil) + linear autoencoder (hmaen)"
#>