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

keep date column in test_scale_lift_measurements #1316

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

malitsadok1
Copy link

@malitsadok1 malitsadok1 commented Dec 25, 2024

Description

Related Issue

Checklist

Modules affected

  • MMM
  • CLV

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pymc-marketing--1316.org.readthedocs.build/en/1316/

@github-actions github-actions bot added the MMM label Dec 25, 2024
@malitsadok1
Copy link
Author

#1311

@juanitorduz juanitorduz requested a review from wd60622 December 25, 2024 19:34
@juanitorduz
Copy link
Collaborator

pre-commit.ci autofix

@juanitorduz juanitorduz added the bug Something isn't working label Dec 25, 2024
[df_lift_test_channel_scaled, df_target_scaled, df_sigma_scaled],
axis=1,
)
if "date" in df_lift_test.columns: ## for time_varying
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about a shorter version like:

components = [df_lift_test_channel_scaled, df_target_scaled, df_sigma_scaled]

if "date" in df_lift_test.columns:
    components.append(df_lift_test[["date"]])

Copy link

codecov bot commented Dec 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.34%. Comparing base (f4fe828) to head (e04068c).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1316      +/-   ##
==========================================
+ Coverage   95.10%   95.34%   +0.23%     
==========================================
  Files          44       47       +3     
  Lines        4703     4966     +263     
==========================================
+ Hits         4473     4735     +262     
- Misses        230      231       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

else:
components = [df_lift_test_channel_scaled, df_target_scaled, df_sigma_scaled]

return pd.concat(components, axis=1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if you could add a test. Maybe @wd60622 can help you with this (I do not know how easy is to add it into the current test-mocking flow :) )

Copy link
Contributor

@wd60622 wd60622 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the change @malitsadok1 !

For a test, I think it would be suffice to show that the model with tvp_media can be built and add a lift test. If you are unfamiliar with pytest, let me know and I can help out.
Also make sure that any current tests will pass

@wd60622
Copy link
Contributor

wd60622 commented Dec 26, 2024

pre-commit.ci autofix

@wd60622 wd60622 changed the title keep date column in test_scale_lift_measurements keep date column in test_scale_lift_measurements Dec 28, 2024
@github-actions github-actions bot added tests TVPs Related to time varying parameters lift tests labels Dec 29, 2024
@@ -474,9 +474,15 @@ def test_scale_lift_measurements(df_lift_test_with_numerics) -> None:
delta_x=lambda row: row["delta_x"] * 2.0,
delta_y=lambda row: row["delta_y"] / 2,
sigma=lambda row: row["sigma"] / 2,
).loc[:, ["channel", "x", "delta_x", "delta_y", "sigma"]]
).loc[:, ["channel", "x", "delta_x", "delta_y", "sigma"] +
(["date"] if "date" in df_lift_test_with_numerics.columns else [])]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this will always be true because of the change in the fixture

mmm.add_lift_test_measurements(
df_lift_test_with_date,
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make an assert statement. Maybe something with the model graph itself

@wd60622 wd60622 added this to the 0.11.0 milestone Dec 29, 2024
@wd60622
Copy link
Contributor

wd60622 commented Dec 29, 2024

pre-commit.ci autofix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lift tests MMM tests TVPs Related to time varying parameters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

time_varying_media and calibration
3 participants