Skip to Content

Machine Learning

The way out of this predicament is to turn to modeling. Instead of working with an enormously large joint probability table, we will approximate the joint probability distribution of the domain with a model. But does this not take us back to the problem of being unable to machine-learn a causal model? No, because we do not need a causal model. Rather, we merely need a statistical model to approximate the statistical relationships of the variables in our domain. Of course, that task is easy. In earlier chapters, we have already introduced various machine learning algorithms in BayesiaLab that can generate Bayesian networks from data.

Given that we have a target variable, i.e., Sales\mathit{Sales}, Supervised Learning will be the appropriate approach. First, we import the dataset:

ACME_Data.csv
CSV

We discretize all variables with the R2GenOpt algorithm into five states. Our choice of this discretization algorithm follows the rationale that we presented in earlier chapters. After importing the dataset, we use the Augmented Naive Bayes algorithm to learn a network with Sales\mathit{Sales} as the Target Node. The result is shown below.

Loading SVG...

Here, we will omit a discussion of the network quality. Rather, we proceed with the given network and look at how to use it to understand our problem domain.

As is, this network has the familiar appearance of a predictive model. And we have kept emphasizing that machine learning can only produce predictive models, which, in turn, are only capable of performing observational inference. However, it is causal inference that we require for the purpose of marketing mix optimization. Clearly, a causal interpretation of the arcs in the above network would not make any sense. After all, Sales\mathit{Sales} is the outcome, not the cause.

This does not matter because we had no intention of finding a causal model with machine learning. We had already given up on finding the true causal model. The model we obtained is only meant to compactly represent the Joint Probability Distribution (JPD) of all variables in this domain.

Our key to causal inference is that we have the JPD, as represented by the machine-learned Bayesian network, and we know, based on domain knowledge and the Disjunctive Cause Criterion, which variables are Confounders.

One issue remains open, though, and that is what mechanism to use for estimation. Recall matching as an estimation technique and, in particular, Likelihood Matching (see Intuition for Matching). Here, for any one treatment and the outcome Sales\mathit{Sales}, there are 13 other variables, eight of which the example uses for adjustment.

Confounders and Non-Confounders

Before proceeding to estimation in BayesiaLab, we need to formally declare which variables are Confounders. In BayesiaLab, all nodes are considered Confounders by default. Hence, we need to declare the inverse condition, i.e., we must tell BayesiaLab which nodes are not Confounders or “Non-Confounders.”

Designate Non-Confounders

As explained under Confounder Selection in Practice, this example treats five variables as downstream of the original causes. Assign Competitive Incentives\mathit{Competitive\ Incentives}, Web Traffic\mathit{Web\ Traffic}, Showroom Traffic\mathit{Showroom\ Traffic}, Test Drives\mathit{Test\ Drives}, and Co-Op Promotions\mathit{Co\text{-}Op\ Promotions} to the predefined Class Non_Confounder\mathrm{Non\_Confounder}.

  • Select the nodes to be added to the Class Non_Confounder\mathrm{Non\_Confounder}.
  • Right-click on one of them to bring up the Contextual Menu.
  • Select Properties > Classes > Add.
  • Select the Predefined Class radio button and choose Non_Confounder\mathrm{Non\_Confounder} from the drop-down menu.

The recording shows the assignment for the first four variables. Repeat the same steps for Co-Op Promotions\mathit{Co\text{-}Op\ Promotions}.

The class now records our modeling choice. The five downstream variables can respond during Direct Effects analysis, while BayesiaLab automatically adjusts for all Confounders.

Add Color to Non-Confounders

To highlight this distinction, we assign colors to each Class.

  • Right-click on the Graph Panel background to bring up the Contextual Menu.
  • Select Edit Classes.
  • In the Class Editor, highlight Non_Confounder\mathrm{Non\_Confounder} in the list and click Associate Colors.
  • From the dialog box, select Associate Default Colors with Classes and click OK.

Now, all Non-Confounders are highlighted in red.

Many Confounders, Many Treatments, Many Levels

Under Estimation Challenges, we already pointed out that stratification is no longer feasible as an estimation technique, which leaves us with matching. However, this example exceeds in complexity of Simpson’s Paradox in a number of ways. In Simpson’s Paradox, we had one Confounder and one treatment variable, which had only one treatment level. Here several drivers have multiple treatment levels. In Observation Mode, the Direct Effects analysis evaluates each driver in turn while Likelihood Matching automatically maintains the marginal distributions of all Confounders for that driver. A causal interpretation requires a sufficient adjustment for the particular treatment. With several related covariates, checking their separate marginals alone does not establish that their joint distribution is balanced across treatment levels.