Skip to content

Commit

Permalink
deploy: 3f3dcbc
Browse files Browse the repository at this point in the history
  • Loading branch information
TomeHirata committed Jul 12, 2024
1 parent aac7b32 commit 1627245
Show file tree
Hide file tree
Showing 29 changed files with 230 additions and 72 deletions.
Binary file modified _images/dte_empirical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/dte_moment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/dte_simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/dte_uniform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/pte_simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/qte.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 31 additions & 23 deletions _modules/dte_adj.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions _modules/dte_adj/plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ <h3>Navigation</h3>
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">Modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">Contribution Guide</a></li>
</ul>

<div class="relations">
Expand Down
1 change: 1 addition & 0 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ <h3>Navigation</h3>
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules.html">Modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contribution Guide</a></li>
</ul>

<div class="relations">
Expand Down
4 changes: 4 additions & 0 deletions _sources/contributing.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Contribution Guide
==================

Regarding how to contribute to this package, please refer to https://github.com/CyberAgentAILab/python-dte-adjustment/CONTRIBUTING.md for more details.
22 changes: 11 additions & 11 deletions _sources/get_started.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ Generate data for training cumulative distribution function:
quadratic_term = np.dot(X**2, gamma)
# Outcome equation
Y = D + linear_term + quadratic_term + U
Y = 5 * D + linear_term + quadratic_term + U
return X, D, Y
n = 100 # Sample size
n = 1000 # Sample size
X, D, Y = generate_data(n)
Then, let's build an empirical cumulative distribution function (CDF).
Expand All @@ -63,13 +63,14 @@ Distributional treatment effect (DTE) can be computed easily in the following co

.. code-block:: python
dte, lower_bound, upper_bound = estimator.predict_dte(target_treatment_arm=1, control_treatment_arm=0, locations=np.sort(Y), variance_type="simple")
locations = np.linspace(Y.min(), Y.max(), 20)
dte, lower_bound, upper_bound = estimator.predict_dte(target_treatment_arm=1, control_treatment_arm=0, locations=locations, variance_type="simple")
A convenience function is available to visualize distribution effects. This method can be used for other distribution parameters including Probability Treatment Effect (PTE) and Quantile Treatment Effect (QTE).

.. code-block:: python
plot(np.sort(Y), dte, lower_bound, upper_bound, title="DTE of simple estimator")
plot(locations, dte, lower_bound, upper_bound, title="DTE of simple estimator")
.. image:: _static/dte_empirical.png
:alt: DTE of empirical estimator
Expand All @@ -92,8 +93,8 @@ DTE can be computed and visualized in the following code.

.. code-block:: python
dte, lower_bound, upper_bound = estimator.predict_dte(target_treatment_arm=1, control_treatment_arm=0, locations=np.sort(Y), variance_type="simple")
plot(np.sort(Y), dte, lower_bound, upper_bound, title="DTE of adjusted estimator with simple confidence band")
dte, lower_bound, upper_bound = estimator.predict_dte(target_treatment_arm=1, control_treatment_arm=0, locations=locations, variance_type="simple")
plot(locations, dte, lower_bound, upper_bound, title="DTE of adjusted estimator with simple confidence band")
.. image:: _static/dte_simple.png
:alt: DTE of adjusted estimator with simple confidence band
Expand All @@ -105,8 +106,8 @@ Confidence bands can be computed in different ways. In the following code, we us

.. code-block:: python
dte, lower_bound, upper_bound = estimator.predict_dte(target_treatment_arm=1, control_treatment_arm=0, locations=np.sort(Y), variance_type="moment")
plot(np.sort(Y), dte, lower_bound, upper_bound, title="DTE of adjusted estimator with moment confidence band")
dte, lower_bound, upper_bound = estimator.predict_dte(target_treatment_arm=1, control_treatment_arm=0, locations=locations, variance_type="moment")
plot(locations, dte, lower_bound, upper_bound, title="DTE of adjusted estimator with moment confidence band")
.. image:: _static/dte_moment.png
:alt: DTE of adjusted estimator with moment confidence band
Expand All @@ -118,8 +119,8 @@ Also, an uniform confidence band is used when "uniform" is specified for the "va

.. code-block:: python
dte, lower_bound, upper_bound = estimator.predict_dte(target_treatment_arm=1, control_treatment_arm=0, locations=np.sort(Y), variance_type="uniform")
plot(np.sort(Y), dte, lower_bound, upper_bound, title="DTE of adjusted estimator with uniform confidence band")
dte, lower_bound, upper_bound = estimator.predict_dte(target_treatment_arm=1, control_treatment_arm=0, locations=locations, variance_type="uniform")
plot(locations, dte, lower_bound, upper_bound, title="DTE of adjusted estimator with uniform confidence band")
.. image:: _static/dte_uniform.png
:alt: DTE of adjusted estimator with uniform confidence band
Expand All @@ -131,7 +132,6 @@ To compute PTE, we can use "predict_pte" method.

.. code-block:: python
locations = np.linspace(Y.min(), Y.max(), 20)
pte, lower_bound, upper_bound = estimator.predict_pte(target_treatment_arm=1, control_treatment_arm=0, width=1, locations=locations, variance_type="simple")
plot(locations, pte, lower_bound, upper_bound, chart_type="bar", title="PTE of adjusted estimator with simple confidence band")
Expand Down
15 changes: 11 additions & 4 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
dte_adj Documentation
dte_adj
===================================

This a Python package for building the regression adjusted distribution function estimator proposed in "Estimating Distributional Treatment Effects in Randomized Experiments: Machine Learning for Variance Reduction".

.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: Contents:

installation
get_started
modules
contributing

Indices and tables
==================
~~~~~~~~~~~~~~~~~~

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
* :ref:`search`

License
~~~~~~~
MIT License
12 changes: 12 additions & 0 deletions _sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ Installation Guide

This package can be installed either through PyPI or source code.

Requirement
~~~~~~~~~~~

You need to use Python version 3.6 or higher to use this package.


Install from PyPI
~~~~~~~~~~~~~~~~~

For installing the package from PyPI, please use the following command.

.. code-block:: bash
pip install dte_adj
Install from source code
~~~~~~~~~~~~~~~~~~~~~~~~

For installing the package from the source code, please use the following commands.

.. code-block:: bash
Expand Down
Binary file modified _static/dte_empirical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/dte_moment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/dte_simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/dte_uniform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/pte_simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/qte.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 110 additions & 0 deletions contributing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!DOCTYPE html>

<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<title>Contribution Guide &#8212; dte_adj 0.1.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d1102ebc" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=12dfc556" />
<script src="_static/documentation_options.js?v=01f34227"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Modules" href="modules.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />





</head><body>


<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">


<div class="body" role="main">

<section id="contribution-guide">
<h1>Contribution Guide<a class="headerlink" href="#contribution-guide" title="Link to this heading"></a></h1>
<p>Regarding how to contribute to this package, please refer to <a class="reference external" href="https://github.com/CyberAgentAILab/python-dte-adjustment/CONTRIBUTING.md">https://github.com/CyberAgentAILab/python-dte-adjustment/CONTRIBUTING.md</a> for more details.</p>
</section>


</div>

</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">dte_adj</a></h1>








<h3>Navigation</h3>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Modules</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Contribution Guide</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="modules.html" title="previous chapter">Modules</a></li>
</ul></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>








</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&#169;2024, CyberAgent, Inc..

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

|
<a href="_sources/contributing.rst.txt"
rel="nofollow">Page source</a>
</div>




</body>
</html>
1 change: 1 addition & 0 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ <h3>Navigation</h3>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contribution Guide</a></li>
</ul>

<div class="relations">
Expand Down
Loading

0 comments on commit 1627245

Please sign in to comment.