API reference

andrey.metrics.coefficient_mae#

andrey.metrics.coefficient_mae(estimated_w, true_w)[source]#

Mean absolute coefficient error over the true edges (edges absent in truth are ignored).

A missed true edge contributes its full |w_true| (so this blends coefficient error with recall on the true support); returns 0.0 when the truth has no weighted edges. Both inputs use the canonical W[i, j] = weight of edge i -> j orientation – note LiNGAM’s B is the transpose, and adapters normalize to this before storing.

Return type:

float

Examples

>>> coefficient_mae([[0.0, 0.9], [0.0, 0.0]], [[0.0, 1.0], [0.0, 0.0]])
0.09999999999999998