
GMM-based anomaly detection: log-density thresholding (hmgand)
Source:R/geron_w4a_native.R
morie_geron_anomaly_gmm.RdMixture fitted by morie_geron_gaussian_mixture (hmgmm).
Usage
morie_geron_anomaly_gmm(
X,
n_components = 2,
threshold = NULL,
contamination = 0.05,
seed = 0,
X_new = NULL
)Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_anomaly_gmm(V)
#> $is_anomaly
#> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
#>
#> $density
#> [1] 0.11490074 0.13278941 0.08385279 0.13335557 0.16601609 0.15612498 0.11090935
#> [8] 0.05951651
#>
#> $log_density
#> [1] -2.163687 -2.018991 -2.478693 -2.014736 -1.795671 -1.857098 -2.199042
#> [8] -2.821501
#>
#> $threshold
#> [1] 0.06710355
#>
#> $log_threshold
#> [1] -2.701518
#>
#> $n_anomalies
#> [1] 1
#>
#> $anomaly_indices
#> [1] 7
#>
#> $new_density
#> NULL
#>
#> $new_log_density
#> NULL
#>
#> $new_is_anomaly
#> NULL
#>
#> $contamination
#> [1] 0.05
#>
#> $gmm
#> $gmm$weights
#> [1] 0.2055403 0.7944597
#>
#> $gmm$means
#> [,1]
#> [1,] 1.481189
#> [2,] 5.281018
#>
#> $gmm$log_likelihood
#> [1] -17.34942
#>
#>
#> $estimate
#> [1] 0.125
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "GMM density thresholding in log space; mixture fitted by hmgmm"
#>