Package: CADF 0.1

Ludwig Steven

CADF: Customer Analytics Data Formatting

Converts customer transaction data (ID, purchase date) into a R6 class called customer. The class stores various customer analytics calculations at the customer level. The package also contains functionality to convert data in the R6 class to data.frames that can serve as inputs for various customer analytics models.

Authors:Ludwig Steven [aut, cre]

CADF_0.1.tar.gz
CADF_0.1.tar.gz(r-4.5-noble)CADF_0.1.tar.gz(r-4.4-noble)
CADF_0.1.tgz(r-4.4-emscripten)CADF_0.1.tgz(r-4.3-emscripten)
CADF.pdf |CADF.html
CADF/json (API)

# Install 'CADF' in R:
install.packages('CADF', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Datasets:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

2.00 score 535 downloads 35 exports 1 dependencies

Last updated 1 months agofrom:6df76c2dbc. Checks:OK: 1 NOTE: 1. Indexed: yes.

TargetResultDate
Doc / VignettesOKDec 01 2024
R-4.5-linuxNOTEDec 01 2024

Exports:annualhalfing_LLannualhalfingmodelbigT_expand_via_applyca_SRMca_SRM_time_varyingca_to_ps_matrixCADF_to_annualhalfing_dataCADF_to_btyd_pareto_nbdCADF_to_logistic_regressionCADF_to_migration_modelCADF_to_nth_purchaseCADF_to_nth_purchase_allrowscreate.purchase.stringcreate.recency.stringCustomerf_CustomerModelingMatrixf_CustomerSurvivalModelingMatrixfrequency_from_psfrequency_from_rlegenerate_date_templateid_to_CADFld_sample_customer_matrixmodeling.annualhalfing.likelihoodmodeling.LL.gamma_spendpdf_gammapdf_gamma2print.glossaryps_to_T_customps_to_T_strict_quitterps_to_T_strict_stayerpsmatrix_to_recency_attimeof_matrixqc_transactional_datasimple_migrationsplit.transaction.file_to_CADFtransitions

Dependencies:R6

Using CADF to Prepare Customer Analytic Datasets

Rendered frommy-vignette.Rmdusingknitr::rmarkdownon Dec 01 2024.

Last update: 2024-10-31
Started: 2024-10-31

Readme and manuals

Help Manual

Help pageTopics
Likelihood maximization for annual halfing customer retention modelannualhalfing_LL
Annual Halfing Modelannualhalfingmodel
Answering machine databass.answeringmachines
bigT_expand_via_applybigT_expand_via_apply
Billionairesbillionaire
ca_SRMca_SRM
Time varying Simple retention model Estimates retention rate using logistic regression and the simple regression model Mostly used for contractual models where there are clear opportunities for cancellation. Could be used in non-contractional situations although the cancellation opportunities should be defined. Not recommended for use with services that consumers use rotating-door style. Use the migration model there.ca_SRM_time_varying
CADF to purchase string Extracts purchase strings from the CADF and formats as a R matrix.ca_to_ps_matrix
cadf.cadf
Convert CADF dataset into annualhalfing model datasetCADF_to_annualhalfing_data
CADF to btyd pareto nbd modelCADF_to_btyd_pareto_nbd
CADF to logistic regressionCADF_to_logistic_regression
CADF_to_migration_model converts CADF data to migration model dataCADF_to_migration_model
CADF_to_nth_purchaseCADF_to_nth_purchase
CADF_to_nth_purchase_allrows inputs CADF data and the desired purchase number that you want to count the nth result of.CADF_to_nth_purchase_allrows
CADF-formatted sample datacadf.data.sample
Function called during Customer$new() (the Customer R6 class) to create purchase string for the customer.create.purchase.string
create_recency_stringcreate.recency.string
R6 Class representing a customer. Otherwise known as the CADF.Customer
Discrete choicediscretechoice
Excel dataexceldata
For each customer, return a modeling matrix that is utilized for logistic regressionf_CustomerModelingMatrix
For each customer, return a survival modeling matrix that is utilized for survival analysisf_CustomerSurvivalModelingMatrix
Compute the months between two purchase datesf_intMonths
Health Datafp
Purchase string to frequency countfrequency_from_ps
RLE object to frequency countfrequency_from_rle
Gamma gamma spend model datagammagamma
generate_date_templategenerate_date_template
Convert to CADF for a single customer idid_to_CADF
LD functions are utilized for learning and diagnostic use.ld_sample_customer_matrix
LTV transactions dataltv.transactions
Likelihood function for annual halfing modelmodeling.annualhalfing.likelihood
LL function for the gamma gamma spend modelmodeling.LL.gamma_spend
PDF probability function for gamma distributionpdf_gamma
Probability density function for gamma distributionpdf_gamma2
The glossary for the CADF data formatprint.glossary
Calculates T from a purchase string. Custom.ps_to_T_custom
Calculates T from a purchase stringps_to_T_strict_quitter
Calculates T from a purchase string under the "strict stayer" assumption.ps_to_T_strict_stayer
psmatrix_to_psstringpsmatrix_to_psstring
accepts a psmatrix converts 1/0 purchase strings to recency at timeofpsmatrix_to_recency_attimeof_matrix
The customer analytics data format (CADF) relays heavily on correct input data. Transactional data must: 1.) be a data frame with two columns 2.) Column one is the customer id 3.) Column 2 is the transaction date. Column 2 must be formatted as a date object in R.qc_transactional_data
Segmentation and LTV datasegltv
Simple Migrationsimple_migration
Create a CADF dataset from a dataframesplit.transaction.file_to_CADF
#' Simple retention model datasrm_data
SRM model datasrm_summaries
Stockmarket put/call datastocks
Transactions datatransactions
#' Transaction datatransactions.merged
Calculate transition periods between two timeperiodstransitions