Skip to content

Commit

Permalink
🐛 Fix typo in multi_aso() code example and fix random seed for multi_…
Browse files Browse the repository at this point in the history
…aso() tests
  • Loading branch information
Kaleidophon committed Oct 15, 2021
1 parent 45c1587 commit 04b5489
Show file tree
Hide file tree
Showing 12 changed files with 387 additions and 65 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ M = 3 # Number of different models / algorithms

# Simulate different model scores by sampling from normal distributions with increasing means
# Here, we will sample from N(0.1, 0.8), N(0.15, 0.8), N(0.2, 0.8)
my_models_scores = [np.random.normal(loc=loc, scale=0.8, size=N) for loc in np.arange(0.1, 0.1 + 0.05 * M, step=0.05)]
my_models_scores = np.array([np.random.normal(loc=loc, scale=0.8, size=N) for loc in np.arange(0.1, 0.1 + 0.05 * M, step=0.05)])

eps_min = multi_aso(my_model_scores, confidence_level=0.05)
eps_min = multi_aso(my_models_scores, confidence_level=0.05)

# eps_min =
# array([[1., 1., 1.],
Expand Down Expand Up @@ -287,7 +287,7 @@ my_models_scores = {
# ...
# }

eps_min = multi_aso(my_model_scores, confidence_level=0.05, return_df=True)
eps_min = multi_aso(my_models_scores, confidence_level=0.05, return_df=True)

# This is now a DataFrame!
# eps_min =
Expand Down
2 changes: 1 addition & 1 deletion README_RAW.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ M = 3 # Number of different models / algorithms

# Simulate different model scores by sampling from normal distributions with increasing means
# Here, we will sample from N(0.1, 0.8), N(0.15, 0.8), N(0.2, 0.8)
my_models_scores = [np.random.normal(loc=loc, scale=0.8, size=N) for loc in np.arange(0.1, 0.1 + 0.05 * M, step=0.05)]
my_models_scores = np.array([np.random.normal(loc=loc, scale=0.8, size=N) for loc in np.arange(0.1, 0.1 + 0.05 * M, step=0.05)])

eps_min = multi_aso(my_models_scores, confidence_level=0.05)

Expand Down
1 change: 1 addition & 0 deletions deepsig/tests/test_aso.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def setUp(self) -> None:
}
self.num_models = 3
self.num_seeds = 100
np.random.seed(5678)
self.scores = [
np.random.normal(loc=0.3, scale=0.2, size=self.num_seeds).tolist()
for _ in range(self.num_models)
Expand Down
6 changes: 3 additions & 3 deletions docs/README_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ M = 3 # Number of different models / algorithms

# Simulate different model scores by sampling from normal distributions with increasing means
# Here, we will sample from N(0.1, 0.8), N(0.15, 0.8), N(0.2, 0.8)
my_models_scores = [np.random.normal(loc=loc, scale=0.8, size=N) for loc in np.arange(0.1, 0.1 + 0.05 * M, step=0.05)]
my_models_scores = np.array([np.random.normal(loc=loc, scale=0.8, size=N) for loc in np.arange(0.1, 0.1 + 0.05 * M, step=0.05)])

eps_min = multi_aso(my_model_scores, confidence_level=0.05)
eps_min = multi_aso(my_models_scores, confidence_level=0.05)

# eps_min =
# array([[1., 1., 1.],
Expand Down Expand Up @@ -287,7 +287,7 @@ my_models_scores = {
# ...
# }

eps_min = multi_aso(my_model_scores, confidence_level=0.05, return_df=True)
eps_min = multi_aso(my_models_scores, confidence_level=0.05, return_df=True)

# This is now a DataFrame!
# eps_min =
Expand Down
6 changes: 3 additions & 3 deletions docs/build/html/README_DOCS.html
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ <h3>Scenario 4 - Comparing more than two models<a class="headerlink" href="#scen

<span class="c1"># Simulate different model scores by sampling from normal distributions with increasing means</span>
<span class="c1"># Here, we will sample from N(0.1, 0.8), N(0.15, 0.8), N(0.2, 0.8)</span>
<span class="n">my_models_scores</span> <span class="o">=</span> <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">normal</span><span class="p">(</span><span class="n">loc</span><span class="o">=</span><span class="n">loc</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="mf">0.8</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="n">N</span><span class="p">)</span> <span class="k">for</span> <span class="n">loc</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span> <span class="o">+</span> <span class="mf">0.05</span> <span class="o">*</span> <span class="n">M</span><span class="p">,</span> <span class="n">step</span><span class="o">=</span><span class="mf">0.05</span><span class="p">)]</span>
<span class="n">my_models_scores</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">normal</span><span class="p">(</span><span class="n">loc</span><span class="o">=</span><span class="n">loc</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="mf">0.8</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="n">N</span><span class="p">)</span> <span class="k">for</span> <span class="n">loc</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span> <span class="o">+</span> <span class="mf">0.05</span> <span class="o">*</span> <span class="n">M</span><span class="p">,</span> <span class="n">step</span><span class="o">=</span><span class="mf">0.05</span><span class="p">)])</span>

<span class="n">eps_min</span> <span class="o">=</span> <span class="n">multi_aso</span><span class="p">(</span><span class="n">my_model_scores</span><span class="p">,</span> <span class="n">confidence_level</span><span class="o">=</span><span class="mf">0.05</span><span class="p">)</span>
<span class="n">eps_min</span> <span class="o">=</span> <span class="n">multi_aso</span><span class="p">(</span><span class="n">my_models_scores</span><span class="p">,</span> <span class="n">confidence_level</span><span class="o">=</span><span class="mf">0.05</span><span class="p">)</span>

<span class="c1"># eps_min =</span>
<span class="c1"># array([[1., 1., 1.],</span>
Expand Down Expand Up @@ -392,7 +392,7 @@ <h3>Scenario 4 - Comparing more than two models<a class="headerlink" href="#scen
<span class="c1"># ...</span>
<span class="c1"># }</span>

<span class="n">eps_min</span> <span class="o">=</span> <span class="n">multi_aso</span><span class="p">(</span><span class="n">my_model_scores</span><span class="p">,</span> <span class="n">confidence_level</span><span class="o">=</span><span class="mf">0.05</span><span class="p">,</span> <span class="n">return_df</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">eps_min</span> <span class="o">=</span> <span class="n">multi_aso</span><span class="p">(</span><span class="n">my_models_scores</span><span class="p">,</span> <span class="n">confidence_level</span><span class="o">=</span><span class="mf">0.05</span><span class="p">,</span> <span class="n">return_df</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

<span class="c1"># This is now a DataFrame!</span>
<span class="c1"># eps_min =</span>
Expand Down
6 changes: 3 additions & 3 deletions docs/build/html/_sources/README_DOCS.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ M = 3 # Number of different models / algorithms

# Simulate different model scores by sampling from normal distributions with increasing means
# Here, we will sample from N(0.1, 0.8), N(0.15, 0.8), N(0.2, 0.8)
my_models_scores = [np.random.normal(loc=loc, scale=0.8, size=N) for loc in np.arange(0.1, 0.1 + 0.05 * M, step=0.05)]
my_models_scores = np.array([np.random.normal(loc=loc, scale=0.8, size=N) for loc in np.arange(0.1, 0.1 + 0.05 * M, step=0.05)])

eps_min = multi_aso(my_model_scores, confidence_level=0.05)
eps_min = multi_aso(my_models_scores, confidence_level=0.05)

# eps_min =
# array([[1., 1., 1.],
Expand Down Expand Up @@ -287,7 +287,7 @@ my_models_scores = {
# ...
# }

eps_min = multi_aso(my_model_scores, confidence_level=0.05, return_df=True)
eps_min = multi_aso(my_models_scores, confidence_level=0.05, return_df=True)

# This is now a DataFrame!
# eps_min =
Expand Down
123 changes: 123 additions & 0 deletions docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,131 @@ <h4>Table Of Contents</h4>
<h1 id="index">Index</h1>

<div class="genindex-jumpbox">
<a href="#A"><strong>A</strong></a>
| <a href="#B"><strong>B</strong></a>
| <a href="#C"><strong>C</strong></a>
| <a href="#D"><strong>D</strong></a>
| <a href="#G"><strong>G</strong></a>
| <a href="#M"><strong>M</strong></a>
| <a href="#P"><strong>P</strong></a>

</div>
<h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#deepsig.aso.aso">aso() (in module deepsig.aso)</a>
</li>
</ul></td>
</tr></table>

<h2 id="B">B</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#deepsig.correction.bonferroni_correction">bonferroni_correction() (in module deepsig.correction)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#deepsig.bootstrap.bootstrap_test">bootstrap_test() (in module deepsig.bootstrap)</a>
</li>
</ul></td>
</tr></table>

<h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#deepsig.correction.calculate_partial_conjunction">calculate_partial_conjunction() (in module deepsig.correction)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#deepsig.aso.compute_violation_ratio">compute_violation_ratio() (in module deepsig.aso)</a>
</li>
</ul></td>
</tr></table>

<h2 id="D">D</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
deepsig

<ul>
<li><a href="index.html#module-deepsig">module</a>
</li>
</ul></li>
<li>
deepsig.aso

<ul>
<li><a href="index.html#module-deepsig.aso">module</a>
</li>
</ul></li>
<li>
deepsig.bootstrap

<ul>
<li><a href="index.html#module-deepsig.bootstrap">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
deepsig.correction

<ul>
<li><a href="index.html#module-deepsig.correction">module</a>
</li>
</ul></li>
<li>
deepsig.permutation

<ul>
<li><a href="index.html#module-deepsig.permutation">module</a>
</li>
</ul></li>
</ul></td>
</tr></table>

<h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#deepsig.aso.get_quantile_function">get_quantile_function() (in module deepsig.aso)</a>
</li>
</ul></td>
</tr></table>

<h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
module

<ul>
<li><a href="index.html#module-deepsig">deepsig</a>
</li>
<li><a href="index.html#module-deepsig.aso">deepsig.aso</a>
</li>
<li><a href="index.html#module-deepsig.bootstrap">deepsig.bootstrap</a>
</li>
<li><a href="index.html#module-deepsig.correction">deepsig.correction</a>
</li>
<li><a href="index.html#module-deepsig.permutation">deepsig.permutation</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#deepsig.aso.multi_aso">multi_aso() (in module deepsig.aso)</a>
</li>
</ul></td>
</tr></table>

<h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#deepsig.permutation.permutation_test">permutation_test() (in module deepsig.permutation)</a>
</li>
</ul></td>
</tr></table>



</div>
Expand Down
Loading

0 comments on commit 04b5489

Please sign in to comment.