Skip to content

Commit

Permalink
Add test for adjust_alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
koheiw committed Aug 22, 2024
1 parent 56671b5 commit fb58ab7
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 @@ -120,8 +120,11 @@ 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_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 fb58ab7

Please sign in to comment.