Skip to content

Commit

Permalink
Merge pull request #86 from koheiw/add-test-adjust
Browse files Browse the repository at this point in the history
Add test for adjust_alpha
  • Loading branch information
koheiw authored Sep 4, 2024
2 parents f0d18b8 + 18481da commit 7287e09
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/testthat/test-textmodel_lda.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ test_that("adjust_alpha works", {

set.seed(1234)
lda <- textmodel_lda(dfmt, max_iter = 200, adjust_alpha = 0.5)

expect_equivalent(rowSums(lda$theta), rep(1.0, ndoc(lda$data)))
expect_equivalent(rowSums(lda$phi), rep(1.0, lda$k))

expect_equal(lda$adjust_alpha, 0.5)
expect_true(all(lda$alpha != 0.5))
expect_true(all(lda$alpha > 0.25))
expect_true(all(lda$epsilon > 0))

expect_error(
Expand Down

0 comments on commit 7287e09

Please sign in to comment.