You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add new Discrete Additive Noise Model class that enforces the outputs to be discrete. This should help in generating more consistent data.
- As part of this, revised the auto assignment function and revised its docstring.
- Revised the auto assignment summary.
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
Copy file name to clipboardExpand all lines: docs/source/user_guide/modeling_gcm/model_evaluation.rst
+32-12Lines changed: 32 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -52,29 +52,49 @@ this, consider the chain structure example X→Y→Z:
52
52
53
53
.. code-block::
54
54
55
-
Analyzed 3 nodes.
55
+
When using this auto assignment function, the given data is used to automatically assign a causal mechanism to each node. Note that causal mechanisms can also be customized and assigned manually.
56
+
The following types of causal mechanisms are considered for the automatic selection:
57
+
58
+
If root node:
59
+
An empirical distribution, i.e., the distribution is represented by randomly sampling from the provided data. This provides a flexible and non-parametric way to model the marginal distribution and is valid for all types of data modalities.
60
+
61
+
If non-root node and the data is continuous:
62
+
Additive Noise Models (ANM) of the form X_i = f(PA_i) + N_i, where PA_i are the parents of X_i and the unobserved noise N_i is assumed to be independent of PA_i.To select the best model for f, different regression models are evaluated and the model with the smallest mean squared error is selected.Note that minimizing the mean squared error here is equivalent to selecting the best choice of an ANM.
63
+
64
+
If non-root node and the data is discrete:
65
+
Discrete Additive Noise Models have almost the same definition as non-discrete ANMs, but come with an additional constraint to return discrete values.
66
+
Note that 'discrete' here refers to numerical values with an order. If the data is categorical, consider representing them as strings to ensure proper model selection.
67
+
68
+
If non-root node and the data is categorical:
69
+
A functional causal model based on a classifier, i.e., X_i = f(PA_i, N_i).
70
+
Here, N_i follows a uniform distribution on [0, 1] and is used to randomly sample a class (category) using the conditional probability distribution produced by a classification model.Here, different model classes are evaluated using the (negative) F1 score and the best performing model class is selected.
71
+
72
+
In total, 3 nodes were analyzed:
73
+
56
74
--- Node: X
57
-
Node X is a root node. Assigning 'Empirical Distribution' to the node representing the marginal distribution.
75
+
Node X is a root node. Therefore, assigning 'Empirical Distribution' to the node representing the marginal distribution.
58
76
59
77
--- Node: Y
60
-
Node Y is a non-root node. Assigning 'AdditiveNoiseModel using LinearRegression' to the node.
78
+
Node Y is a non-root node with continuous data. Assigning 'AdditiveNoiseModel using LinearRegression' to the node.
61
79
This represents the causal relationship as Y := f(X) + N.
62
80
For the model selection, the following models were evaluated on the mean squared error (MSE) metric:
Note, based on the selected auto assignment quality, the set of evaluated models changes.
97
+
For more insights toward the quality of the fitted graphical causal model, consider using the evaluate_causal_model function after fitting the causal mechanisms.
78
98
79
99
In this scenario, an empirical distribution is assigned to the root node X, while additive noise models are applied
80
100
to nodes Y and Z. In both of these cases, a linear regression model demonstrated the best performance in terms
0 commit comments