predict.clv.fitted.spending: Predict customers' future spending

View source: R/f_interface_predict_clvfittedspending.R

predict.clv.fitted.spendingR Documentation

Predict customers' future spending

Description

Predict customer's future mean spending per transaction and compare it to the actual mean spending in the holdout period.

Usage

## S3 method for class 'clv.fitted.spending'
predict(object, newdata = NULL, verbose = TRUE, ...)

## S4 method for signature 'clv.fitted.spending'
predict(object, newdata = NULL, verbose = TRUE, ...)

Arguments

object

A fitted spending model for which prediction is desired.

newdata

A clv data object for which predictions should be made with the fitted model. If none or NULL is given, predictions are made for the data on which the model was fit.

verbose

Show details about the running of the function.

...

Ignored

Details

If newdata is provided, the individual customer statistics underlying the model are calculated the same way as when the model was fit initially. Hence, if remove.first.transaction was TRUE, this will be applied to newdata as well.

Value

An object of class data.table with columns:

Id

The respective customer identifier

actual.mean.spending

Actual mean spending per transaction in the holdout period. Only if there is a holdout period otherwise it is not reported.

predicted.mean.spending

The mean spending per transaction as predicted by the fitted spending model.

See Also

models to predict spending: gg.

models to predict transactions: pnbd, bgnbd, ggomnbd.

predict for transaction models

Examples


data("apparelTrans")

# Fit gg model on data
apparel.holdout <- clvdata(apparelTrans, time.unit="w",
                           estimation.split=37, date.format="ymd")
apparel.gg <- gg(apparel.holdout)

# Predict customers' future mean spending per transaction
predict(apparel.gg)




bachmannpatrick/CLVTools documentation built on Oct. 29, 2023, 2:16 p.m.