Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"incorrect number of probabilities" error #4

Closed
TommyJones opened this issue Mar 30, 2020 · 4 comments
Closed

"incorrect number of probabilities" error #4

TommyJones opened this issue Mar 30, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@TommyJones
Copy link
Owner

From this build: https://ci.appveyor.com/project/TommyJones/tidylda/builds/31746411

"incorrect number of probabilities"

Error originates in tidylda:::recover_counts_from_probs

@TommyJones TommyJones added the bug Something isn't working label Mar 30, 2020
@TommyJones
Copy link
Owner Author

Since this function is called during all three of tidylda, refit.tidylda, and predict.tidylda, it can, at random, break the whole deal.

Yay.

@TommyJones
Copy link
Owner Author

Huzzah! A new error from this function

Error in sample.int(length(x), size, replace, prob) :
cannot take a sample larger than the population when 'replace = FALSE'

Code that mad it is below. Didn't set random seed, no guarantee of reproducibility.

tcm <- textmineR::CreateTcm(
    doc_vec = textmineR::nih_sample$ABSTRACT_TEXT,skipgram_window = 10
)

emb1 <- tidylda(
    dtm = tcm, 
    k = 100, iterations = 200, 
    burnin = 175, 
    beta = colSums(skee) / sum(skee) * 100, clac_r2 = TRUE)

@TommyJones
Copy link
Owner Author

@TommyJones
Copy link
Owner Author

95% sure that this fixed it

72310a3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant