2
$\begingroup$

I recently discovered the concept of "causal inference" and I'm trying to understand if I've grasped its essence correctly. If I understand it correctly, it involves finding what influences the outcome while being able to quantify the importance of each variable. In this sense, how is it different from sensitivity analysis?

There's also something else I haven't been able to fully comprehend from the examples I've seen. With the DoWhy toolbox in Python, it appears possible to construct a relationship graph between the data. Do we need to specify the structure of the graph ourselves, or is it an algorithm that determines it automatically?

Assuming it's the algorithm that determines the graph automatically, can we use this graph as a guideline to build a cascading machine learning model?

thx for highlight

$\endgroup$
6
  • $\begingroup$ If you entirely discard machine learning, and instead begin with a statistics and experimental design perspective, understanding Causal Inference becomes much simpler. Thereafter, seeing the separation from Sensitivity Analysis will become simple. If you then want to reintroduce ML, via the CausalML and PyWhy approaches, it all becomes more straightforward, and you can then apply Sensitivity Analysis on the causal ML models. IMO, both of these Python libraries are still maturing, as they do, explaining their roles and procedures will get clearer. $\endgroup$
    – pds
    Commented Jun 8 at 8:40
  • $\begingroup$ Causal inference, yes, is guided by declaring the limits of the preconceived causal relationships, that lead to some outcome. We define some experimental design e.g. give drug/placebo (exposure) which leads to cured-cancer/still-has-cancer (outcome). If crash-car-and-die (confounding covariate variable) can also effect the outcome; which is measured or not measured (unobserved). We make this assumed causal graph (DAG), and then we go get data (dataset or do data collection), model the data and measure some metric like Propensity Score or Average Treatment Effect (ATE). $\endgroup$
    – pds
    Commented Jun 8 at 8:49
  • $\begingroup$ Once you have a model, then you can apply Sensitivity Analysis. $\endgroup$
    – pds
    Commented Jun 8 at 8:50
  • $\begingroup$ See DAGitty as a tool for creating those causal graphs. Note, that your preconceived causal assumptions might be wrong. After collecting and modelling the data for a given DAG, you might discover a change (e.g. add a new covariate). Then you repeat the data collection and modelling process, to see if the model's performance metrics and the PS/ATE improve. $\endgroup$
    – pds
    Commented Jun 8 at 8:56
  • $\begingroup$ No, the "causal relationship graph" (Causal DAG) is not automatically created from a dataset. You can be much more creative with influencing causal factors (as example above); not limited by a dataset's limits. In fact starting with a dataset, overly constrains a causal modelling procedure. $\endgroup$
    – pds
    Commented Jun 8 at 8:58

1 Answer 1

1
$\begingroup$

Your post has 2 questions, so I will try to answer both:

Difference between Causal Inference (CI) and Sensitivity Analysis (SA).

Sensitivity Analysis (SA) can be described as the following (Naik & Kiran, 2021):

“a popular feature selection approach employed to identify the important features in a dataset. In sensitivity analysis, each input feature is perturbed one-at-a-time and the response of the machine learning model is examined to determine the feature's rank.”

This definition shows that SA gives you a ranked list of the important features in your data, which is very good insights as to which feature to use/focus on (can also do this after feature engineering/transformations to check if they would be useful).

On the other hand, the goal of Causal Inference (CI) requires you to identify a causal graph from your data, which can then be used in your model to A) make predictions and B) query the model for insights that traditional ML methods cannot give, such as interventions.

This causal graph that you need to build explains the cause and effects between the features and the target, and between the features themselves. For example, let’s say we have 2 features X and Z and a target Y. This shows that X directly affects the target, but also indirectly affects the target via the feature Z. It’s this type of information that CI takes into account that SA doesn’t.

example of a graph with 3 nodes: X, Y and Z and 3 relationships X->Y, Z->Y, X->Z

Manual VS automatic graph construction

You can do either manual graph construction, automatic graph construction, or a mix of both!

A manual graph construction implies that you have enough knowledge about your data/domain to create a causal graph yourself (which features impact one another and which impact the target + the relationship of that impact e.g., the direction of the relationship and the type). The goal is to end up with a DAG (Directed Acyclic Graph) with no loops between your features and their connections.

However, you don’t always have this knowledge at hand, so you can do automatic graph construction to get started. To simplify the search space, you can do Sensitivity Analysis to highlight the most important features and focus on the most important ones at first to build your causal graph.

The output of automatic graph construction algorithms is rarely perfect, so this is where the mix of both comes in: you manually fix the automatically created graph with knowledge that you have about your data, which will allow you to correct relationships between your features (correct the direction or the relationship between them). And at the end of the process, you hopefully have a DAG that you can pass to your model along with your data!

Readings

I recommend reading the following:

Hope this helps.

References

Naik, D.L., kiran, R. A novel sensitivity-based method for feature selection. J Big Data 8, 128 (2021). https://doi.org/10.1186/s40537-021-00515-w

$\endgroup$
2
  • $\begingroup$ Where to find code/library to automatically create a causal graph? Thanks $\endgroup$
    – pds
    Commented Jun 8 at 9:16
  • $\begingroup$ If you already have a graph, you can use cai-causal-graph, else you can use DoWhy for causal discovery (to discovery relationships in your data and build a graph) $\endgroup$ Commented Jun 11 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.