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

Failing test: tests/clv/models/test_shifted_beta_geo.py::TestShiftedBetaGeoModel::test_distribution_customer_churn_time #620

Closed
juanitorduz opened this issue Apr 8, 2024 · 5 comments · Fixed by #623

Comments

@juanitorduz
Copy link
Collaborator

I am seeing the test tests/clv/models/test_shifted_beta_geo.py::TestShiftedBetaGeoModel::test_distribution_customer_churn_time fail in the CI (see for example https://github.com/pymc-labs/pymc-marketing/actions/runs/8606924039/job/23586352229?pr=619, but it happens in all recent PRs) with

args = (<function assert_allclose.<locals>.compare at 0x7f6033ec4430>, array([7.84 , 8.647, 8.493]), array([10.        ,  2.        ,  1.11111111]))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0.05, atol=0', 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Not equal to tolerance rtol=0.05, atol=0
E           
E           Mismatched elements: 3 / 3 (100%)
E           Max absolute difference: 7.38188889
E           Max relative difference: 6.6437
E            x: array([7.84 , 8.647, 8.493])
E            y: array([10.      ,  2.      ,  1.111111])

/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/contextlib.py:79: AssertionError

but I can not reproduce locally with pymc 5.12 ... could it be a 5.13 issue ? FYI @ColtAllen

@wd60622
Copy link
Contributor

wd60622 commented Apr 9, 2024

Seeing this failure but also experiencing a change in one of test outcomes for mocking prior

@juanitorduz
Copy link
Collaborator Author

I can confirm in pymc 5.12 it passes but fails on pymc 5.13

@juanitorduz
Copy link
Collaborator Author

With pymc 5.12 the test passes and the values being compared are

(Pdb) res.mean(("chain", "draw"))
<xarray.DataArray 'churn' (customer_id: 3)> Size: 24B
array([9.857, 2.012, 1.13 ])
Coordinates:
  * customer_id  (customer_id) int64 24B 0 1 2
(Pdb) stats.geom(customer_thetas).mean()
array([10.        ,  2.        ,  1.11111111])

@wd60622
Copy link
Contributor

wd60622 commented Apr 10, 2024

What is the latest on this?

@juanitorduz
Copy link
Collaborator Author

I have not been able to fix it. I'll try in the upcoming days. Maybe @ricardoV94 can take a look sometime in the next days 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants