clvkit.clv.clv.CLVResult#

class CLVResult(data, *, horizon, discount_rate, margin, time_unit)[source]#

Bases: object

Discounted expected residual lifetime value, per customer.

Carries every factor of equation (1), not just their product, so the number can be interrogated: a CLV that looks wrong is usually a DET that looks wrong or a spend estimate that looks wrong, and separating them is the difference between a diagnosis and a shrug.

Parameters:
property description: str#

Unit-aware axis label — the horizon is not implied by the numbers.

to_pandas()[source]#

The four factors of equation (1), indexed by customer_id.

Return type:

DataFrame

to_json()[source]#

Customer-keyed JSON, the same shape as to_pandas().

Return type:

str

plot(**kwargs)[source]#

Draw CLV against its discounted transaction and spend factors.

Forwards to clvkit.plotting.plot_clv(); every option it takes is typed through PlotCLVOptions, so an editor completes and checks them here as if they were spelled out.

Parameters:

kwargs (Unpack[PlotCLVOptions])

Return type:

Axes