Results explanation

After passing our model evaluation stage, and deciding to select the estimated and evaluated model as our final model, our next task is to interpret the results for the company executives and technicians.

In terms of explaining the machine learning results, the company is particularly interested in understanding how their past interventions affected customer churns, and also how their product features and services influence customer churns.

So, we will work on results explanation, focusing on calculating the effects of several interventions or some product and service features for which MLlib does not offer good functions now. Therefore, in reality, we export the estimated models, and use other tools for results explanation and visualization. However, it is expected that the future releases of MLlib will have these easy functions included soon.

Calculating the impact of interventions

With logistic regression, the process of producing scores is relatively easy; it uses the following formulae for logistic regression:

Calculating the impact of interventions

Specifically, Prob(Yi=1) = exp(BXi)/(1+exp(BXi)) produces the default probability, with Y=1 as default, X as a sum of all the features, and B as a vector of coefficients.

So, we will need to write some code with coefficients obtained from the previous sections to directly produce the impact assessments.

On the other hand, we can use the following code to produce the needed impact assessments for which we can load new data, calculate the predicted values, and then export them.

// Compute raw scores on the test set.

val predictionAndLabels = test.map { case LabeledPoint(label, features) =>
  val prediction = model.predict(features)
  (prediction, label)
}

According to the model evaluation work described in the previous section, randomForest models perform the best. With randomForest, we can list out all the features by their importance, which gives another insight for interpreting the effects of features on customer churn.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.31.163