generated from coulomb/repo-seed
Implement customer-tuning solver and close WP-0006
This commit is contained in:
@@ -185,7 +185,7 @@ def _discount_rate(policy: LTVPolicy) -> Decimal:
|
||||
return Decimal("1") + (policy.monthly_discount_rate_pct / Decimal("100"))
|
||||
|
||||
|
||||
def _required_threshold(reference_ltv: Decimal, factor: Decimal) -> Decimal:
|
||||
def required_improvement_threshold(reference_ltv: Decimal, factor: Decimal) -> Decimal:
|
||||
if reference_ltv >= Decimal("0"):
|
||||
return _money(reference_ltv * factor)
|
||||
improvement = abs(reference_ltv) * (factor - Decimal("1"))
|
||||
@@ -412,7 +412,7 @@ def compare_pricing_configurations(
|
||||
threshold: Decimal | None = None
|
||||
passes_required_improvement = True
|
||||
if reference is not None and estimate.model_id != reference.model_id:
|
||||
threshold = _required_threshold(
|
||||
threshold = required_improvement_threshold(
|
||||
reference.average_comparable_customer_lifetime_value,
|
||||
policy.required_improvement_factor,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user