Transactional churn prediction sample guide

This guide will walk you through an end-to-end example of transactional churn prediction using sample data. We recommend that you try this prediction in a new environment.

Scenario

Contoso is a company that produces high-quality coffee and coffee machines. They sell the products through their Contoso Coffee website. Their goal is to know which customers who typically purchase their products on a regular basis, will stop being active customers in the next 60 days. Knowing which of their customers is likely to churn, can help them save marketing efforts by focusing on keeping them.

Prerequisites

Task 1 - Ingest data

Review the articles about data ingestion and connecting to a Power Query data source. The following information assumes you are familiar with ingesting data in general.

Ingest customer data from eCommerce platform

  1. Create a data source named eCommerce and select the Text/CSV connector.

  2. Enter the URL for eCommerce contacts https://aka.ms/ciadclasscontacts.

  3. While editing the data, select Transform and then Use first row as headers.

  4. Update the datatype for the columns listed below:

    • DateOfBirth: Date
    • CreatedOn: Date/Time/Zone

    Transform DoB to Date.

  5. In the Name field on the right-hand pane, rename your data source to eCommerceContacts

  6. Save the data source.

Ingest online purchase data

  1. Add another data set to the same eCommerce data source. Choose the Text/CSV connector again.

  2. Enter the URL for online purchases data https://aka.ms/ciadclassonline.

  3. While editing the data, select Transform and then Use first row as headers.

  4. Update the datatype for the columns listed below:

    • PurchasedOn: Date/Time
    • TotalPrice: Currency
  5. In the Name field on the right-hand pane, rename your data source to eCommercePurchases.

  6. Save the data source.

Ingest customer data from loyalty schema

  1. Create a data source named LoyaltyScheme and select the Text/CSV connector.

  2. Enter the URL for eCommerce contacts https://aka.ms/ciadclasscustomerloyalty.

  3. While editing the data, select Transform and then Use first row as headers.

  4. Update the datatype for the columns listed below:

    • DateOfBirth: Date
    • RewardsPoints: Whole Number
    • CreatedOn: Date/Time
  5. In the Name field on the right-hand pane, rename your data source to loyCustomers.

  6. Save the data source.

Task 2 - Data unification

Review the article about data unification. The following information assumes you are familiar with data unification in general.

After ingesting the data, begin the data unification process to create a unified customer profile. For more information, see Data unification.

Describe the customer data to be unified

  1. After ingesting the data, map contacts from eCommerce and Loyalty data to common data types. Go to Data > Unify.

  2. Select the tables that represent the customer profile – eCommerceContacts and loyCustomers.

    unify ecommerce and loyalty datasources.

  3. Select ContactId as the primary key for eCommerceContacts and LoyaltyID as the primary key for loyCustomers.

  4. Select Next. Skip duplicate records and select Next.

Define matching rules

  1. Choose eCommerceContacts : eCommerce as the primary table and include all records.

  2. Choose loyCustomers : LoyaltyScheme and include all records.

  3. Add a rule:

    • Select FullName for both eCommerceContacts and loyCustomers.
    • Select Type (Phone, Name, Address, ...) for Normalize.
    • Set Precision Level: Basic and Value: High.
  4. Add a second condition for email address:

    • Select Email for both eCommerceContacts and loyCustomers.
    • Leave Normalize blank.
    • Set Precision Level: Basic and Value: High.
    • Enter FullName, Email for the name.

    Unify match rule for name and email.

  5. Select Done.

  6. Select Next.

View unified data

  1. Rename the ContactId for loyCustomers table to ContactIdLOYALTY to differentiate it from the other IDs ingested.

  2. Select Next to review and then select Create customer profiles.

Task 3 - Create transaction history activity

Review the article about customer activities. The following information assumes you are familiar with creating activities in general.

  1. Create an activity with the eCommercePurchases:eCommerce table.

  2. Select SalesOrderLine for the Activity Type and PurchaseId for the Primary key.

  3. Enter the following information for the activity:

    • Activity name: eCommercePurchases
    • TimeStamp: PurchasedOn
    • EventActivity: TotalPrice
    • Order line ID: PurchaseId
    • Order date: PurchasedOn
    • Amount: TotalPrice
  4. Create a relationship between eCommercePurchases:eCommerce and eCommerceContacts:eCommerce with ContactID as the foreign key to connect the two tables.

  5. Review your changes and then select Create activities.

Task 4 - Configure transaction churn prediction

With the unified customer profiles in place and activity, run the transaction churn prediction.

  1. Go to Insights > Predictions.

  2. On the Create tab, select Use model on the Customer churn model.

  3. Select Transactional for the type of churn and then Get started.

  4. Name the model OOB eCommerce Transaction Churn Prediction and the output table OOBeCommerceChurnPrediction.

  5. Select Next.

  6. Define model preferences:

    • Prediction window: 60 days to define how far into the future we want to predict customer churn.

    • Churn definition: 60 days to indicate the duration without purchase after which a customer is considered churned.

      Select the model preferences Prediction Window and Churn Definition.

  7. Select Next.

  8. Select Purchase History (required) and select Add data for purchase history.

  9. Select SalesOrderLine and the eCommercePurchases table and select Next. The required data is automatically filled in from the activity. Select Save and then Next.

    Join eCommerce tables.

  10. Skip the Additional data (optional) step.

  11. In the Data updates step, select Monthly for the model schedule.

  12. After reviewing all the details, select Save and Run.

Task 5 - Review model results and explanations

Let the model complete the training and scoring of the data. Review the churn model explanations. For more information, see View prediction results.

Task 6 - Create a segment of high churn-risk customers

Running the production model creates a new table, which is listed on Data > Tables. You can create a new segment based on the table created by the model.

  1. On the results page, select Create segment.

  2. Create a rule using the OOBeCommerceChurnPrediction table and define the segment:

    • Field: ChurnScore
    • Operator: greater than
    • Value: 0.6
  3. Select Save and Run the segment.

You now have a segment that is dynamically updated which identifies high churn-risk customers. For more information, see Create and manage segments.

Tip

You can also create a segment for a prediction model from the Insights > Segments page by selecting New and choosing Create from > Insights. For more information, see Create a new segment with quick segments.

Next steps