mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Update 0.2 docs
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.7.0" />
|
||||
<meta name="generator" content="pdoc 0.7.5" />
|
||||
<title>miplearn.tests.test_benchmark API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link href='https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css' rel='stylesheet'>
|
||||
@@ -55,24 +55,10 @@ def test_benchmark():
|
||||
benchmark = BenchmarkRunner(test_solvers)
|
||||
benchmark.fit(train_instances)
|
||||
benchmark.parallel_solve(test_instances, n_jobs=2, n_trials=2)
|
||||
assert benchmark.raw_results().values.shape == (12, 14)
|
||||
assert benchmark.results.values.shape == (12, 14)
|
||||
|
||||
benchmark.save_results("/tmp/benchmark.csv")
|
||||
assert os.path.isfile("/tmp/benchmark.csv")
|
||||
|
||||
benchmark = BenchmarkRunner(test_solvers)
|
||||
benchmark.load_results("/tmp/benchmark.csv")
|
||||
assert benchmark.raw_results().values.shape == (12, 14)
|
||||
|
||||
|
||||
def test_gap():
|
||||
assert BenchmarkRunner._compute_gap(ub=0.0, lb=0.0) == 0.0
|
||||
assert BenchmarkRunner._compute_gap(ub=1.0, lb=0.5) == 0.5
|
||||
assert BenchmarkRunner._compute_gap(ub=1.0, lb=1.0) == 0.0
|
||||
assert BenchmarkRunner._compute_gap(ub=1.0, lb=-1.0) == 1.0
|
||||
assert BenchmarkRunner._compute_gap(ub=1.0, lb=None) == 1.0
|
||||
assert BenchmarkRunner._compute_gap(ub=None, lb=1.0) == 1.0
|
||||
assert BenchmarkRunner._compute_gap(ub=None, lb=None) == 1.0</code></pre>
|
||||
benchmark.write_csv("/tmp/benchmark.csv")
|
||||
assert os.path.isfile("/tmp/benchmark.csv")</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
@@ -109,33 +95,10 @@ def test_gap():
|
||||
benchmark = BenchmarkRunner(test_solvers)
|
||||
benchmark.fit(train_instances)
|
||||
benchmark.parallel_solve(test_instances, n_jobs=2, n_trials=2)
|
||||
assert benchmark.raw_results().values.shape == (12, 14)
|
||||
assert benchmark.results.values.shape == (12, 14)
|
||||
|
||||
benchmark.save_results("/tmp/benchmark.csv")
|
||||
assert os.path.isfile("/tmp/benchmark.csv")
|
||||
|
||||
benchmark = BenchmarkRunner(test_solvers)
|
||||
benchmark.load_results("/tmp/benchmark.csv")
|
||||
assert benchmark.raw_results().values.shape == (12, 14)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="miplearn.tests.test_benchmark.test_gap"><code class="name flex">
|
||||
<span>def <span class="ident">test_gap</span></span>(<span>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<section class="desc"></section>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def test_gap():
|
||||
assert BenchmarkRunner._compute_gap(ub=0.0, lb=0.0) == 0.0
|
||||
assert BenchmarkRunner._compute_gap(ub=1.0, lb=0.5) == 0.5
|
||||
assert BenchmarkRunner._compute_gap(ub=1.0, lb=1.0) == 0.0
|
||||
assert BenchmarkRunner._compute_gap(ub=1.0, lb=-1.0) == 1.0
|
||||
assert BenchmarkRunner._compute_gap(ub=1.0, lb=None) == 1.0
|
||||
assert BenchmarkRunner._compute_gap(ub=None, lb=1.0) == 1.0
|
||||
assert BenchmarkRunner._compute_gap(ub=None, lb=None) == 1.0</code></pre>
|
||||
benchmark.write_csv("/tmp/benchmark.csv")
|
||||
assert os.path.isfile("/tmp/benchmark.csv")</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -157,14 +120,13 @@ def test_gap():
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="miplearn.tests.test_benchmark.test_benchmark" href="#miplearn.tests.test_benchmark.test_benchmark">test_benchmark</a></code></li>
|
||||
<li><code><a title="miplearn.tests.test_benchmark.test_gap" href="#miplearn.tests.test_benchmark.test_gap">test_gap</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.7.0</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.7.5</a>.</p>
|
||||
</footer>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad()</script>
|
||||
|
||||
Reference in New Issue
Block a user