Skip to content

Rename sample_prior to sample #508

Open
@williambdean

Description

@williambdean

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


This issue was transferred from pymc-labs/pymc-marketing#1346

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions