Merging BetaGeo Time-Invariant Covariates model from feature sub-branch into main master branch:
It is worth noting the PR #11 with the base lifetimes repo is failing tests/test_estimation.py::TestGammaGammaFitter::test_customer_lifetime_value_with_bgf:
def test_customer_lifetime_value_with_bgf(self, cdnow_customers_with_monetary_value):
ggf = lt.GammaGammaFitter()
ggf.params_ = pd.Series({"p": 6.25, "q": 3.74, "v": 15.44})
bgf = lt.BetaGeoFitter()
bgf.fit(
cdnow_customers_with_monetary_value["frequency"],
cdnow_customers_with_monetary_value["recency"],
cdnow_customers_with_monetary_value["T"],
)
ggf_clv = ggf.customer_lifetime_value(
bgf,
cdnow_customers_with_monetary_value["frequency"],
cdnow_customers_with_monetary_value["recency"],
cdnow_customers_with_monetary_value["T"],
cdnow_customers_with_monetary_value["monetary_value"],
)
utils_clv = utils._customer_lifetime_value(
bgf,
cdnow_customers_with_monetary_value["frequency"],
cdnow_customers_with_monetary_value["recency"],
cdnow_customers_with_monetary_value["T"],
ggf.conditional_expected_average_profit(
cdnow_customers_with_monetary_value["frequency"], cdnow_customers_with_monetary_value["monetary_value"]
),
)
> npt.assert_equal(ggf_clv.values, utils_clv.values)
E AssertionError:
E Arrays are not equal
E
E x and y nan location mismatch:
E x: array([140.12518 , 18.948848, 38.232656, ..., 47.335732, 466.544731,
E 47.335732])
E y: array([ nan, 140.12518 , 18.948848, ..., 712.964802, 47.335732,
E 466.544731])
tests/test_estimation.py:223: AssertionError
However, this matter is largely inconsequential as both models will be refactored to run on the pymc4 backend and deprecated.
Merging BetaGeo Time-Invariant Covariates model from
feature
sub-branch into mainmaster
branch:It is worth noting the PR #11 with the base
lifetimes
repo is failingtests/test_estimation.py::TestGammaGammaFitter::test_customer_lifetime_value_with_bgf
:However, this matter is largely inconsequential as both models will be refactored to run on the
pymc4
backend and deprecated.