Skip to content

Commit

Permalink
v0.21.0:
Browse files Browse the repository at this point in the history
- New return value: Expected R2 confidence intervals
- Caution: return order changed, reverse-compatibility broken
  • Loading branch information
spisakt committed Sep 26, 2022
1 parent 5d35c8e commit 363eb5b
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 39 deletions.
Binary file modified docs/_build/.doctrees/environment.pickle
Binary file not shown.
15 changes: 15 additions & 0 deletions docs/_build/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ <h1 id="index">Index</h1>

<div class="genindex-jumpbox">
<a href="#C"><strong>C</strong></a>
| <a href="#E"><strong>E</strong></a>
| <a href="#F"><strong>F</strong></a>
| <a href="#G"><strong>G</strong></a>
| <a href="#I"><strong>I</strong></a>
Expand All @@ -55,6 +56,20 @@ <h2 id="C">C</h2>
</ul></td>
</tr></table>

<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="docs.html#mlconfound.stats.CptResults.expected_r2_x_y">expected_r2_x_y (mlconfound.stats.CptResults attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="docs.html#mlconfound.stats.ResultsFullyConfounded.expected_r2_y_yhat">expected_r2_y_yhat (mlconfound.stats.ResultsFullyConfounded attribute)</a>
</li>
<li><a href="docs.html#mlconfound.stats.ResultsPartiallyConfounded.expected_r2_yhat_c">expected_r2_yhat_c (mlconfound.stats.ResultsPartiallyConfounded attribute)</a>
</li>
</ul></td>
</tr></table>

<h2 id="F">F</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand Down
Binary file modified docs/_build/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ The random seed is set for reproducible results. The flag
``return_null_dist`` is set so that the full permutation-based null
distribution is returned, e.g. for plotting purposes.

The pandas dataframe is solely created for “pretty-printing” the
results.


.. code:: ipython3
Expand Down Expand Up @@ -101,8 +100,10 @@ results.
<th>ci lower</th>
<th>ci upper</th>
<th>R2(y,c)</th>
<th>R2(y^,c)</th>
<th>R2(y,y^)</th>
<th>Expected R2(y^,c)</th>
<th>Observed R2(y^,c)</th>

</tr>
</thead>
<tbody>
Expand All @@ -112,14 +113,17 @@ results.
<td>0.732287</td>
<td>0.786173</td>
<td>0.187028</td>
<td>0.031732</td>
<td>0.210914</td>
<td>[0.024, 0.04, 0.059]</td>
<td>0.031732</td>
</tr>
</tbody>
</table>
</div>


The p-value provides no evidence to reject our null-hypothesis of uncounfoudned model.
The observed coefficient-of-determination is well within the expected range (given by 5%, 50% and 95% percentiles).

Let’s use the built-in plot functions of the package ``mlconfound`` for
a graphical representation of the results.
Expand Down Expand Up @@ -198,8 +202,9 @@ confounded model.
<th>ci lower</th>
<th>ci upper</th>
<th>R2(y,c)</th>
<th>R2(y^,c)</th>
<th>R2(y,y^)</th>
<th>Expected R2(y^,c)</th>
<th>Observed R2(y^,c)</th>
</tr>
</thead>
<tbody>
Expand All @@ -209,8 +214,10 @@ confounded model.
<td>0.017867</td>
<td>0.039042</td>
<td>0.187028</td>
<td>0.067903</td>
<td>0.237854</td>
<td>[0.027, 0.044, 0.065]</td>
<td>0.067903</td>

</tr>
</tbody>
</table>
Expand Down Expand Up @@ -238,6 +245,8 @@ confounded model.
The low p-value provides evidence against the null hypothesis of
:math:`y` being conditionally independent on :math:`c` given :math:`y`
and indicates that the model predictions are biased.
The observed coefficient-of-determination falls outside of the expected range (given by 5%, 50% and 95% percentiles).


+-----------------------------------------------------------------------+
| Note |
Expand Down
Loading

0 comments on commit 363eb5b

Please sign in to comment.