# Cause-Effect Analysis of Indivisual Samples

Individual sample causal inference is a new branch of statistical causal inference.

This field is more famous as a method of AI explainability and interpretability (XAI). As an application, it can also be used as a method of statistical causal inference.

## Differences from Cause-Effect Analysis between Variables

Causal inference between variables is a way to find out that it is this variable that is affecting the value of this variable. In the field called "causal inference" or "statistical causal inference", methods of causal inference between variables have been studied. In general, when we talk about "causal inference" or "statistical causal inference", we are only talking about causal inference between variables.

In contrast, the causal inference of individual samples is It is a way to find out that it is this variable that is affecting the value of this sample.

• Cause-Effect Analysis between Variables : Examine explanatory variables that are important for the model (objective variable). Examine the correlation between variables.
• Cause-Effect Analysis of Indivisual Samples : Examine variables that are important for a particular sample

## How to use

I wrote that it is used as an explainability and interpretability of AI, but in AI, for example, it is used as a method to understand that "this image was judged as an abnormality in this area".

For causal inference, process analysis of abnormal conditions can be used as a use.

### Differences in use from Cause-Effect Analysis between Variables

What you can find in the way you look at causality between variables is the relationship between the variables, as is common to all samples. For example, "On hot days, the cost of electricity increases."

Causal inferences from individual samples can tell us, for example, "why the cost of electricity increased even though it was not hot."

If the variables that cause the anomaly are always the same, it is easier to investigate the causal relationship between the variables.

On the other hand, if there are various patterns in the variables that cause abnormalities, it can only be examined by examining individual samples. Especially if you say that this variable was abnormal only for that sample, it is easy to overlook it if you do not examine the individual samples.

## Methods

In the application of the method of causal inference between variables, the position of the sample to be examined in multidimensional space is the information as a characteristic of the sample to be examined.

In SHAP, you can see the characteristics of the sample you want to examine in terms of its relationship to the objective variable.

### Application of the method of Cause-Effect Analysis between Variables

Apply the method of causal inference between variables to the causal inference of individual samples.

This application can be used in label classification methods, such as decision trees and MT methods.

In these ways, if the label (value of the target variable) of the sample to be examined is, for example, "NG" and the rest is "OK", You can examine the differences between the samples you want to examine and the samples that you don't.

Decision trees allow you to make causal inferences about individual samples because you can see which leaves are classified into and how they are branched.

For methods other than decision trees, analyze variable importance to determine which variables affect the sample you want to examine.

### SHAP

SHAP is a method of examining important explanatory variables for the value of the target variable for individual samples.

Both objective variables and explanatory variables can be used for quantitative data.

SHAP is a method of investigating which explanatory variables have a greater influence on the value of the objective variable of a specific sample in machine learning models such as multiple regression analysis, decision trees, and neural networks.

## Software

### R

Samples by R is in Cause-Effect Analysis of Indivisual Sampless by R .