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

Rename sample_prior to sample #1346

Open
wd60622 opened this issue Jan 5, 2025 · 0 comments
Open

Rename sample_prior to sample #1346

wd60622 opened this issue Jan 5, 2025 · 0 comments
Labels
model components Related to the various model components request discussion

Comments

@wd60622
Copy link
Contributor

wd60622 commented Jan 5, 2025

Would it make sense to have sample_prior be just sample? The idea was to have a similar API to the components which have a method of the same name. However, their workflows are a bit different.

For instance, Prior class:

from pymc_marketing.prior import Prior

dist = Prior("Normal")
samples = dist.sample_prior()
# purposed alternative
samples = dist.sample()

The HSGP class has a similar workflow to Prior class.

Similar workflow from the components (Saturation, Adstock, Fourier, LinearTrend, etc)

  1. sample_prior
  2. sample_curve which takes either prior or posterior
  3. plot_curve which takes the curve
from pymc_marketing.mmm import LogisticSaturation

saturation = LogisticSaturation()
prior = saturation.sample_prior()
curve = saturation.sample_curve(prior)
saturation.plot_curve(curve)

Maybe there can be same renaming argument for the components as well.

Would be interested to hear thoughts

Related to #1345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model components Related to the various model components request discussion
Projects
None yet
Development

No branches or pull requests

1 participant