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

TestBetaGeo setup_class is too slow #172

Closed
ricardoV94 opened this issue Feb 22, 2023 · 2 comments
Closed

TestBetaGeo setup_class is too slow #172

ricardoV94 opened this issue Feb 22, 2023 · 2 comments

Comments

@ricardoV94
Copy link
Contributor

ricardoV94 commented Feb 22, 2023

The setup_class of TestBetaGeo is too slow as it performs MCMC sampling on a synthetic dataset. We should make this a fixture of tests that actually need it (if there's more than one), and possibly mark them with @pytest.mark.slow so that they are not run locally by default.

cls.fixed_model.fit(chains=1, progressbar=False, random_seed=cls.rng)

For other tests I have faked posterior draws by doing prior sampling with narrow priors around the "expected" values, and setting that as the posterior dataset. This allows us to check the summary methods work as expected without doing slow mcmc sampling.

CC @larryshamalama

@ColtAllen
Copy link
Collaborator

I'm working on the ParetoNBD PR right now, and have added pytest fixtures for CDNOW_sample.csv and CDNOW_master.csv which could potentially resolve this issue. These CSVs contain 2,357 and 23,570 rows respectively, and any tests using them should probably be marked as @pytest.mark.slow.

My opinion on using CDNOW for testing has flip-flopped in recent weeks because even CDNOW_master is much smaller than many datasets encountered in practice, but these are real-world benchmarks used in many research papers, and will be useful for testing against lifetimes MLE convergence and reproducing research results.

@ColtAllen
Copy link
Collaborator

Resolved in #709

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

No branches or pull requests

2 participants