Standard Case: Customer Response Prediction for a Marketing Campaign
Scénario de test & Cas d'usage
Business Context
A financial services company wants to predict which customers are likely to respond to a new loan offer. The goal is to build a reliable classification model using customer demographics and historical data, partition the data for validation, and save the final model for future scoring of new customer lists.
Create a dataset simulating customer profiles and their response to a previous campaign. Predictors include Age, Income, number of existing products, and home ownership status. The target 'Responded' is binary (1/0).
Copied!
data customer_offers;\n call streaminit(2024);\n do CustomerID = 1 to 20000;\n Age = 22 + floor(rand('Uniform') * 48);\n Income = 45000 + floor(rand('Uniform') * 150000);\n ExistingProducts = 1 + floor(rand('Uniform') * 5);\n if rand('Uniform') < 0.6 then OwnsHome = 'Yes';\n else OwnsHome = 'No';\n logit_p = -2.5 + (Age / 20) - (Income / 90000) + (ExistingProducts * 0.3) - (ifc(OwnsHome='Yes', 0.5, 0));\n p = 1 / (1 + exp(-logit_p));\n Responded = rand('Bernoulli', p);\n output;\n end;\nrun;\n\ndata casuser.customer_offers_train;\n set customer_offers;\nrun;
The action should successfully train a model and produce fit statistics for both training and testing partitions. A CAS table 'customer_response_preds' will be created containing the predicted probabilities for each customer. A model store table 'bart_loan_model' will also be created in the active caslib, ready for use with the bartScore action.