predict.GMMCluster <- function(object, newdata, ...) {
predict_GMM(newdata, object$centroids, object$covariance_matrices, object$weights)$cluster_labels
}
|
predict_GMM(newdata, object$centroids, object$covariance_matrices, object$weights)$cluster_labels |
I wonder why this bug is not caught in the test:
|
testthat::test_that("GMM predict method works", { |
|
gmm = GMM(dat, 3) |
|
testthat::expect_equal(predict_GMM(dat, |
|
CENTROIDS = gmm$centroids, |
|
COVARIANCE = gmm$covariance_matrices, |
|
WEIGHTS = gmm$weights)$cluster_labels, |
|
predict(gmm, dat)) |
|
}) |
ClusterR/R/clustering_functions.R
Line 200 in 02cef28
I wonder why this bug is not caught in the test:
ClusterR/tests/testthat/test-gmm.R
Lines 395 to 402 in 02cef28