{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Influence Estimation" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%%capture\n", "# execute the creation & training notebook first\n", "%run \"02-01-creation_and_training.ipynb\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After [training](./02-01-creation_and_training.ipynb) we might want to know how much our parameters influence a certain target. We can do this with the ``.estimate_influences`` method." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's start by estimating the influences on the parameter '(c|a,b)'." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(a) 0.675741\n", "(b|a) 3.677125\n", "(c|a,b) 1.000000\n", "Name: influence on (c|a,b), dtype: float64" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "causal_structure.estimate_influences(target='(c|a,b)')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We see that '(c|a,b)' influences itself by 1, that is to say it influences itself by 100%.\n", "'(a)' influences it by 66%. This seems fairly in line with the R2-score in the [performance evaluation section](./02-04-evaluation.ipynb)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "However, '(b|a)' shows an influence above 100%. How can this be understood?\n", "\n", "### Influences of correlated parameters\n", "\n", "The reason why '(b|a)' shows an influence above 100% is that\n", "'(a)' and '(b|a)' are strongly anti-correlated" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | (a) | \n", "(b|a) | \n", "
---|---|---|
(a) | \n", "1.000000 | \n", "-0.959284 | \n", "
(b|a) | \n", "-0.959284 | \n", "1.000000 | \n", "