Skip to content

predict.GMMCluster only returns cluster labels #73

Description

@koheiw
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))
})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions