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

Move fit_result to model_builder.py and remove redundancies from CLV and MMM #1344

Merged
merged 10 commits into from
Jan 8, 2025

Conversation

sreekailash
Copy link
Contributor

@sreekailash sreekailash commented Jan 5, 2025

Description

Have made the following changes:

  1. Add fit_result similar to posterior in the model_builder since it is still used across many files
  2. Added a property() setter to tackle the setter function in the basic.py in CLV
  3. Removed fit_result from MMM and CLV base

Submitting a draft PR and appreciate any feedback.

Related Issue

Checklist

Modules affected

  • MMM
  • CLV
  • Customer Choice

Type of change

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

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

Copy link

codecov bot commented Jan 5, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.34%. Comparing base (3b95b77) to head (3603a05).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pymc_marketing/model_builder.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1344      +/-   ##
==========================================
- Coverage   95.35%   95.34%   -0.01%     
==========================================
  Files          47       47              
  Lines        4951     4943       -8     
==========================================
- Hits         4721     4713       -8     
  Misses        230      230              

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

@sreekailash
Copy link
Contributor Author

@wd60622 Created a draft PR. Let me know if these changes look good to you for this issue.

pymc_marketing/model_builder.py Outdated Show resolved Hide resolved
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.

Looking good in package. Could you move any related tests into the model_builder test suite now. For instance, if there are checks for warnings in clv tests, just move to model_builder now and remove from clv

@sreekailash
Copy link
Contributor Author

Thanks. Let me do that and also run all the unit tests once. Let me get back in a bit

@wd60622 wd60622 marked this pull request as ready for review January 7, 2025 11:11
@github-actions github-actions bot added the tests label Jan 8, 2025
@sreekailash
Copy link
Contributor Author

sreekailash commented Jan 8, 2025

EDIT - Fixing the failing checks

@wd60622 Did move two tests from CLV test_basic.py to test_model_builder.py. However, I did run unit tests and they ALL seem to fail with an error "pytensor.link.c.exceptions.CompileError: Compilation failed (return status=1)". I am sure this is related to my local dev environment and how it is setup. Seems like it is an open issue too - pymc-devs/pytensor#991.

TL;DR - I think the PR is okay and the errors are local env specific. Let me know if you want me to move any other test. I don't think other tests should be moved but I may be wrong.

Screenshot 2025-01-08 at 1 17 31 PM

@wd60622
Copy link
Contributor

wd60622 commented Jan 8, 2025

I am fixing the fixtures then the tests should pass

@wd60622 wd60622 added maintenance ModelBuilder Related to the ModelBuilder class and its children labels Jan 8, 2025
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 @sreekailash

@wd60622 wd60622 merged commit 9684821 into pymc-labs:main Jan 8, 2025
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLV maintenance MMM ModelBuilder Related to the ModelBuilder class and its children tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants