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

Fix bug in predictive methods of ParetoNBD model with covariates #589

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pymc_marketing/clv/models/pareto_nbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,6 @@ def distribution_new_customer_dropout(
data: pd.DataFrame, optional
DataFrame containing the following columns:
* `customer_id`: unique customer identifier
* `T`: time between the first purchase and the end of the observation period.
* covariates: Purchase and dropout covariate columns if original model had any.
If not provided, the method will use the fit dataset.
random_seed: RandomState, optional
Expand All @@ -934,7 +933,7 @@ def distribution_new_customer_dropout(

def distribution_new_customer_purchase_rate(
self,
data,
data: Optional[pd.DataFrame] = None,
*,
random_seed: Optional[RandomState] = None,
) -> xarray.Dataset:
Expand All @@ -945,6 +944,11 @@ def distribution_new_customer_purchase_rate(

Parameters
----------
data: pd.DataFrame, optional
DataFrame containing the following columns:
* `customer_id`: unique customer identifier
* covariates: Purchase and dropout covariate columns if original model had any.
If not provided, the method will use the fit dataset.
random_seed : RandomState, optional
Random state to use for sampling.

Expand All @@ -961,7 +965,7 @@ def distribution_new_customer_purchase_rate(

def distribution_new_customer_recency_frequency(
self,
data,
data: Optional[pd.DataFrame] = None,
*,
T: Optional[Union[int, np.ndarray, pd.Series]] = None,
random_seed: Optional[RandomState] = None,
Expand Down
Loading