Get startedGet started for free

Prediction vs. inference dilemma

1. Prediction vs. inference dilemma

Great work! We've learned about the types of problems machine learning can solve, as well as about the different machine learning technologies and job role types. Now we will explore machine learning goals and the different business questions they attempt to solve.

2. Inference vs. prediction dilemma

Let's first distinguish inference or causal models from prediction ones. The inference or causal models focus on answering the drivers and their importance to a certain business outcome, like churn, fraud or customer satisfaction. For example "what are the main indicators of churn", "which product features are the stickiest", or "what are the drivers of fraud". Also, as the name implies, their goal is to provide interpretable insights. "Interpretable" means - It's easy to understand what the model does and to explain it. On the flip side, they're less complex therefore not as accurate as the prediction focused models. Now, the one and only goal of the prediction models is to get the best prediction, no matter how complex and non-interpretable the model is. They work as the so called black boxes and learn complex patterns in data which gives them superior accuracy compared to causal models.

3. Start with the business question

Let's look into a couple of examples to cement our knowledge - we'll ask a business question and tag it as either inference or prediction focused machine learning problem. Let's say we're asking what the main drivers of fraud are. Since we are looking for causal insights, this is an inference model. Another example - how much certain conditions affect heart attack risk? Again, we want to weigh the effects of different conditions, that is get inference. Now, if we're looking to identify which transactions are likely fraudulent - this is a prediction focused problem, since we are attempting to assign a risk probability. Finally, again a health example - scoring customers by their probability of a heart attack is a prediction focused problem, since we're not after the causes, but just after the assigned risk.

4. Modeling data structure

Now, we'll look into the modeling data structure, and explain the inference vs prediction distinction visually. Here's a typical modeling data structure. This is a customer transactions dataset with the goal to predict if they are likely fraudulent.

5. Target variable

The target variable is what we are trying to predict - which in our case is the probability that this transaction is a fraud.

6. Input features

Then, for each transaction we have a number of columns with data points collected about that transaction, customer or any other information the bank could collect. Some features could be how many credit cards does the customer have, how many declined transactions did they have in the past, credit history, whether transaction amount is above or below historical average, and so on.

7. Using input features

Machine learning models use the input features about the transactions,

8. Predicting target variable

and then predict the target variable of interest.

9. Inference model focus

Now, the inference or causal models are specifically interested in understanding how much do the certain transaction attributes affect the fraud probability. They want to get an explanation regarding what kind of transactions are more likely to be fraudulent, and use those insights to make strategic business decisions.

10. Prediction model focus

The prediction models only care about getting the most accurate prediction of whether this transaction is a fraud. The business will use the probability to select the riskiest transactions and deal with them separately.

11. Let's practice!

We've learned two different goals of machine learning - the inference versus prediction dilemma - and we saw multiple examples. Let's go test your knowledge!