customer-insights-azure-dat.../lab05.md

15 KiB
Исходник Постоянная ссылка Ответственный История

Lab 5 - Import Machine Learning Predictions into Customer Insights


Contents

Lab Overview

Introduction

Objectives

Exercise 1: Import Machine Learning Output to Customer Insights

Summary

Lab Overview

Introduction

This final lab will close the loop by importing back to Customer Insights the results of your machine learning model which predicts which customers are likely to churn.

Objectives

The objectives of this exercise are to:

  • Learn how to import the results from your machine learning model back into Customer Insights

The estimated time for this lab is 45 minutes

Exercise 1: Import Machine Learning Output to Customer Insights

In this section you will learn how to import the results of your machine learning models into Customer Insights.

Step 1: Copy the storage account key for your Azure ML storage account

  1. Browse to https://portal.azure.com and sign in with your organizational account.

    Search for “asastore” in the search box at the top:

    Graphical user interface, text, application, email Description automatically generated
  2. On the Security + networking… Access keys blade, click the “Show keys” button:

    Graphical user interface, text, application Description automatically generated
  3. Click the Copy to clipboard button on the right side of the Key textbox under the key1 section:

Step 2: Import Machine Learning Output to Customer Insights

  1. Browse to https://home.ci.ai.dynamics.com/ and sign in with your organizational account.

    On the Data… Data sources left nav, click the “+ Add data source” button:

    Graphical user interface, text, application, email Description automatically generated
  2. Choose Microsoft Power Query and give it the name “AzureMlResults” and click Next.

  3. Click the Azure tab in the Power Query Online window and click the Azure Blobs option:

  4. In the “Account name or URL” type in the name of your storage account for Azure ML (asastore<suffix>) replacing your suffix. Change the Authentication kind to Account key. Paste in the storage account key for your asastore<suffix> storage account. Click Next.

    Graphical user interface, application Description automatically generated
  5. Click the checkbox on the container called “azureml-blobstore-<guid>” and click the Transform data button.

    Graphical user interface, application, table Description automatically generated
  6. On the Name column click the dropdown and choose Text filters… Equals:

  7. Paste “azureml/Decision_Tree_Results/dtresults/data.csv” into the Filter rows dialog and click Ok.

    Graphical user interface, application Description automatically generated
  8. Power Query Online should now show one row with the CSV file which is the output of your ML model. Click the [Binary] link in the Content column for that one row:

    Graphical user interface, application, Word Description automatically generated
  9. The columns in your ML results file should show on the screen. On the Transform tab, click the “Use first row as headers” button:

    Graphical user interface, application Description automatically generated
  10. The first row has now been promoted to column headers. Now click the ABC button on the Scored Probabilities column and choose “Decimal number” to convert that column to a decimal.

    Table Description automatically generated
  11. Rename this query to PredictedCustomerChurn.

    Table Description automatically generated
  12. On the “Add column” tab click the “Conditional column” button:

    Graphical user interface, application Description automatically generated
  13. Name the new column ChurnRisk and setup the conditions as follows. If the model predicts the customer will not churn (Scored Labels=No), return Low. If the model predicts they have a 50% or greater probability of churning (because if it got to this condition, Scored Labels must equal Yes, and Scored Probabilities > .5) return High. Otherwise return Medium. Then click OK and click Next.

    Table Description automatically generated with medium confidence
  14. Accept manually should be selected. Click Save:

    Graphical user interface, text Description automatically generated
  15. Click the radio button to the left of the AzureMlResults data source and click the Refresh button at the top of the screen.

    Graphical user interface, text, application Description automatically generated
  16. On the Data… Unify left nav, click the Edit fields button.

    Graphical user interface, application Description automatically generated
  17. Click the checkmark next to the PredictedCustomerChurn entity and click Apply:

    Graphical user interface, application Description automatically generated
  18. Click the PredictedCustomerChurn entity and set the primary key to customerID and click Save.

    Graphical user interface, application Description automatically generated
  19. Go to the Match tab and click the “+Add entity” button and choose the PredictedCustomerChurn entity:

    Graphical user interface, text, application, email Description automatically generated
  20. Click the “+Add rule” button under the AzureMlResults : PredictedCustomerChurn entity:

    Graphical user interface, text, application, email, Teams Description automatically generated
  21. Choose the CustomerDemographics entity and the customerID fields on both entities. Name this rule and click Done:

    Graphical user interface, text, application Description automatically generated
  22. Click Save and then Run at the top of the screen:

    Graphical user interface, application Description automatically generated
  23. Once the run is successful, your results should look like:

    Graphical user interface, text Description automatically generated with medium confidence
  24. On the Merge tab, click the “Excluded fields” link:

    Graphical user interface, text, application Description automatically generated
  25. Click the arrow next to Scored Labels, Scored Probabilities, and ChurnRisk fields to include those fields in the merging. Click the Done button.

    Graphical user interface, text, application, email Description automatically generated
  26. Scroll down to the bottom of the field list, mouse over the Scored Labels field and click the Rename button. Rename Scored Labels to “PredictedChurn”. Rename Scored Probabilities to “PredictedChurnProbability”.

    Graphical user interface, application Description automatically generated

    Graphical user interface, text, application, email Description automatically generatedGraphical user interface, text, application Description automatically generated

  27. Click Save and Run… Run Only Merge at the top of the screen.

    Graphical user interface, application Description automatically generated
  28. Once the run is successful, go to the Data… Entities left nav, click on the Customer entity, go to the Data tab and scroll to the right. You should see that the PredictedChurn and PredictedChurnProbability are now included as fields in the customer entity. For clarity, customer 0423-UDIJQ has not yet churned (Churn=No) but has a 52% probability of churning (PredictedChurn=Yes, PredictedChurnProbability=0.52) at some point soon per the ML model. Customer 2480-JZOSN has not yet churned (Churn=No) and the model predicts with a probability of 36% that they will not churn (PredictedChurn=No, PredictedChurnProbability=0.36). In other words, a high (close to 1.0) PredictedChurnProbability doesnt alone mean they are predicted to churn. The probability is the probability associated to the PredictedChurn field. The customers with a blank PredictedChurn were part of the training set in Azure Machine Learning so no prediction was made.

    Graphical user interface, text, application, email Description automatically generated

Step 3: Segment your customers at highest risk of churning

  1. Go to the Customers left nav and click “Search & filter index”. Lets find any customers which have a high probability of churning.

    Graphical user interface, application Description automatically generated
  2. Click the “+Add” button to add a field to the index:

    Graphical user interface, text, application, email Description automatically generated
  3. Check the Churn, PredictedChurn and ChurnRisk fields (decimal fields are not currently supported) and click Add.

    Graphical user interface, application, Word Description automatically generated
  4. Mouse over the ChurnRisk field and click the funnel icon to enable filtering on this field. Do the same for the Churn field.

    Graphical user interface, text, application, table Description automatically generated
  5. When prompted after clicking the funnel icon, accept the default options and click OK.

    Graphical user interface, application Description automatically generated
  6. Then click the Save and Run buttons. When refreshing completes, click the Back to Customers button.

    In the right side Filter customers pane, filter to Churn=No (not currently churned) and ChurnRisk=High (high predicted risk of churning soon). Now you have filtered your 7,000 customers down to a list of 478 customers at highest risk of churn. Lets take action on this list of customers.

    Graphical user interface, text, application, email Description automatically generated
  7. Click the Save filters as segment link and enter a name for this new segment of customers. Click Save.

    Graphical user interface, text, application, email Description automatically generated
  8. Click Activate.

    Graphical user interface, text, application Description automatically generated
  9. Go to the Segments left nav, select the Customers at High Risk of Churn segment, wait for it to finish refreshing, then click the Download button. You can send this file to your customer care department and ask them to come up with strategies to boost customer satisfaction and improve retention for these high risk customers.

    Graphical user interface, text, email Description automatically generated

Summary

In this lab, you imported the results of your machine learning model back into Customer Insights and merged this information into the Customer entity. Now you are able to take action from Customer Insights on customers who are predicted to churn.

Next, go to Lab 6.