Files
sql-server-samples/samples/features/r-services/Telco Customer Churn v3/SQL Server/README.md
T
Zhou Fang 6021862dd2 New version of telco customer churn demo
This new version of telco churn demo leverages R, RevoScaleR and
MicrosoftRML packages in SQL Server 2016.
2016-08-22 16:13:26 +08:00

1.2 KiB

Instructions

  • After executing those R scripts, an edw_cdr SQL table will be created.
  • Run the code in telcoChurn-operationalize.sql
  • Run the code in telcoChurn-main.sql

Description

  • telcoChurn-main.sql - Use this T-SQL script to try out the telco customer churn example.
  • telcoChurn-operationalize.sql - T-SQL scripts to create the stored procedures used in this example.

The database consists of the following tables

  • cdr_models - Contains the serialized R models that are used for predicting customer churn
  • edw_cdr- Base Call Detail Records (CDR)
  • edw_cdr_train- Training data
  • edw_cdr_test - Testing data
  • edw_cdr_pred - Predicted results

and the following stored procedures

  • generate_cdr_mx_fasttree - Train gradient tree boosting model with the mxFastTree algorithm in MicrosoftRML library
  • predict_cdr_mx_fasttree - Predict customer churn using the trained model
  • model_evaluate - Generate model performance metrics: Accuracy, Precision, Recall, F-score
  • model_roccurve - Generate ROC curve
  • pie - Create a pie chart to visualize the proportion of predicted customer churn
  • stackedbar - Create a stacked bar chart to visualize the model confusion matrix