Skip to content

Commit

Permalink
Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
peekxc committed Sep 9, 2024
1 parent 36e8518 commit 3530a81
Show file tree
Hide file tree
Showing 37 changed files with 679 additions and 222 deletions.
19 changes: 16 additions & 3 deletions docs/cluster.mean_shift.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,25 @@
<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./cluster.mean_shift.html">Cluster (<code>cluster</code>)</a></li><li class="breadcrumb-item"><a href="./cluster.mean_shift.html">cluster.mean_shift</a></li></ol></nav>
<div class="quarto-title">
<h1 class="title">cluster.mean_shift</h1>
</div>



<div class="quarto-title-meta">




</div>



</header>


<section id="geomcover.cluster.mean_shift" class="level1">
<h1>cluster.mean_shift</h1>
<p><code>cluster.mean_shift(P, Q=None, kernel='gaussian', bandwidth='scott', batch=25, maxiter=300, atol=1.1920929e-06, blur=False, callback=None)</code></p>
<p>Mean shift algorithm for clustering or smoothing points via kernel density estimation.</p>
<p>This functions repeatedly mean shifts points <code>P</code> with respect to reference points <code>Q</code>, returning the shifted points. If <code>Q</code> is not supplied the shift points are shifted w.r.t <code>P</code>, or the shift points themselves if <code>blur = True</code>, until either <code>maxiter</code> iterations is reached the distance shifted is less than <code>atol</code> (elementwise), whichever comes first.</p>
Expand Down Expand Up @@ -394,7 +408,6 @@ <h2 class="anchored" data-anchor-id="returns">Returns</h2>
</table>


</section>
</section>

</main> <!-- /main -->
Expand Down
25 changes: 24 additions & 1 deletion docs/cover.coverage.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@
<a href="./cover.valid_cover.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">cover.valid_cover</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./cover.set_cover.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">cover.set_cover</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
Expand Down Expand Up @@ -219,14 +225,31 @@
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" role="navigation" aria-expanded="true">
<span class="menu-text">I/O (<code>io</code>)</span></a>
<span class="menu-text">Cluster (<code>cluster</code>)</span></a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" role="navigation" aria-expanded="true" aria-label="Toggle section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./cluster.mean_shift.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">cluster.mean_shift</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" role="navigation" aria-expanded="true">
<span class="menu-text">I/O (<code>io</code>)</span></a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" role="navigation" aria-expanded="true" aria-label="Toggle section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-5" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./io.load_set_cover.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">io.load_set_cover</span></a>
</div>
Expand Down
21 changes: 17 additions & 4 deletions docs/cover.set_cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,25 @@
<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./cover.coverage.html">Set Cover (<code>cover</code>)</a></li><li class="breadcrumb-item"><a href="./cover.set_cover.html">cover.set_cover</a></li></ol></nav>
<div class="quarto-title">
<h1 class="title">cover.set_cover</h1>
</div>



<div class="quarto-title-meta">




</div>



</header>


<section id="geomcover.cover.set_cover" class="level1">
<h1>cover.set_cover</h1>
<p><code>cover.set_cover(subsets, weights=None, method='RR', **kwargs)</code></p>
<p>Computes an approximate solution to the weighted set cover problem.</p>
<p>This is essentially a lightweight wrapper around the various set cover implementations, which can be configured via the <code>method</code> argument (supported options are {‘RR’, ‘GREEDY’, ‘ILP’, ‘SAT’}). All additional keyword-arguments are forwarded to their subsequent solvers.</p>
Expand Down Expand Up @@ -329,7 +343,7 @@ <h2 class="anchored" data-anchor-id="parameters">Parameters</h2>
</tr>
<tr class="odd">
<td><code>**kwargs</code></td>
<td>dict[str, Any]</td>
<td>dict</td>
<td>additional keyword arguments to pass to the solver.</td>
<td><code>{}</code></td>
</tr>
Expand Down Expand Up @@ -358,7 +372,6 @@ <h2 class="anchored" data-anchor-id="returns">Returns</h2>
</table>


</section>
</section>

</main> <!-- /main -->
Expand Down
21 changes: 17 additions & 4 deletions docs/cover.set_cover_greedy.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,25 @@
<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./cover.coverage.html">Set Cover (<code>cover</code>)</a></li><li class="breadcrumb-item"><a href="./cover.set_cover_greedy.html">cover.set_cover_greedy</a></li></ol></nav>
<div class="quarto-title">
<h1 class="title">cover.set_cover_greedy</h1>
</div>



<div class="quarto-title-meta">




</div>



</header>


<section id="geomcover.cover.set_cover_greedy" class="level1">
<h1>cover.set_cover_greedy</h1>
<p><code>cover.set_cover_greedy(subsets, weights=None)</code></p>
<p>Approximates the weighted set cover problem via <em>greedy steps</em>.</p>
<p>This function iteratively constructs a set cover by choosing the set that covers the largest number of yet uncovered elements with the least weight.</p>
Expand Down Expand Up @@ -390,11 +404,10 @@ <h2 class="anchored" data-anchor-id="notes">Notes</h2>
<h2 class="anchored" data-anchor-id="references">References</h2>
<ol type="1">
<li>Feige, Uriel. “A threshold of ln n for approximating set cover.” Journal of the ACM (JACM) 45.4 (1998): 634-652.</li>
<li><a href="https://courses.grainger.illinois.edu/cs583/sp2018/Notes/covering.pdf">CS 583 notes by Chandra Chekuri</a></li>
<li><a href="https://courses.grainger.illinois.edu/cs583/sp2018/Notes/covering.pdf">CS 583 notes by Chandra Chekuri</a>ng.pdf)</li>
</ol>


</section>
</section>

</main> <!-- /main -->
Expand Down
21 changes: 17 additions & 4 deletions docs/cover.set_cover_ilp.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,25 @@
<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./cover.coverage.html">Set Cover (<code>cover</code>)</a></li><li class="breadcrumb-item"><a href="./cover.set_cover_ilp.html">cover.set_cover_ilp</a></li></ol></nav>
<div class="quarto-title">
<h1 class="title">cover.set_cover_ilp</h1>
</div>



<div class="quarto-title-meta">




</div>



</header>


<section id="geomcover.cover.set_cover_ilp" class="level1">
<h1>cover.set_cover_ilp</h1>
<p><code>cover.set_cover_ilp(subsets, weights=None, solver='highs')</code></p>
<p>Approximates the weighted set cover problem via <em>integer linear programming</em>.</p>
<p>This function attempts to directly solve weighted set cover problem by reducing it to the following mixed-integer linear program:</p>
Expand Down Expand Up @@ -393,11 +407,10 @@ <h2 class="anchored" data-anchor-id="returns">Returns</h2>
<section id="see-also" class="level2">
<h2 class="anchored" data-anchor-id="see-also">See Also</h2>
<ul>
<li><a href="scipy.optimize.milp">Mixed-integer program</a></li>
<li><a href="scipy.optimize.milp">Mixed-integer program</a>ilp)</li>
</ul>


</section>
</section>

</main> <!-- /main -->
Expand Down
50 changes: 3 additions & 47 deletions docs/cover.set_cover_rr.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,6 @@
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>


Expand Down Expand Up @@ -466,19 +432,9 @@ <h2 class="anchored" data-anchor-id="notes">Notes</h2>
</section>
<section id="examples" class="level2">
<h2 class="anchored" data-anchor-id="examples">Examples</h2>
<div id="48618f1c" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> geomcover.cover <span class="im">import</span> set_cover_rr</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> geomcover.io <span class="im">import</span> load_set_cover</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a>subsets, weights <span class="op">=</span> load_set_cover(<span class="st">"mushroom"</span>)</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a>soln, cost <span class="op">=</span> set_cover_rr(subsets, weights)</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a>n, J <span class="op">=</span> subsets.shape</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">"Set family with </span><span class="sc">{n}</span><span class="st"> elements and </span><span class="sc">{J}</span><span class="st"> sets can be covered with {np.sum(soln)} sets with cost </span><span class="sc">{cost}</span><span class="st">."</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>Set family with {n} elements and {J} sets can be covered with {np.sum(soln)} sets with cost {cost}.</code></pre>
</div>
</div>
<p>from geomcover.cover import set_cover_rr from geomcover.io import load_set_cover</p>
<p>subsets, weights = load_set_cover(“mushroom”) soln, cost = set_cover_rr(subsets, weights) n, J = subsets.shape</p>
<p>print(“Set family with {n} elements and {J} sets can be covered with {np.sum(soln)} sets with cost {cost}.”) ``````</p>


</section>
Expand Down
44 changes: 40 additions & 4 deletions docs/cover.set_cover_sat.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@
<a href="./cover.valid_cover.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">cover.valid_cover</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./cover.set_cover.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">cover.set_cover</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
Expand Down Expand Up @@ -219,14 +225,31 @@
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" role="navigation" aria-expanded="true">
<span class="menu-text">I/O (<code>io</code>)</span></a>
<span class="menu-text">Cluster (<code>cluster</code>)</span></a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" role="navigation" aria-expanded="true" aria-label="Toggle section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./cluster.mean_shift.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">cluster.mean_shift</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" role="navigation" aria-expanded="true">
<span class="menu-text">I/O (<code>io</code>)</span></a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" role="navigation" aria-expanded="true" aria-label="Toggle section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-5" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./io.load_set_cover.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">io.load_set_cover</span></a>
</div>
Expand Down Expand Up @@ -266,11 +289,25 @@
<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./cover.coverage.html">Set Cover (<code>cover</code>)</a></li><li class="breadcrumb-item"><a href="./cover.set_cover_sat.html">cover.set_cover_sat</a></li></ol></nav>
<div class="quarto-title">
<h1 class="title">cover.set_cover_sat</h1>
</div>



<div class="quarto-title-meta">




</div>



</header>


<section id="geomcover.cover.set_cover_sat" class="level1">
<h1>cover.set_cover_sat</h1>
<p><code>cover.set_cover_sat(subsets, weights=None, full_output=False, **kwargs)</code></p>
<p>Computes an approximate solution to the weighted set cover problem via <em>weighted MaxSAT</em>.</p>
<p>This function converts the problem of finding a minimal weight set cover to a weighted MaxSAT instance, which is known to achieve at least an (8/7)-approximation of the optimal solution.</p>
Expand Down Expand Up @@ -342,7 +379,6 @@ <h2 class="anchored" data-anchor-id="returns">Returns</h2>
</table>


</section>
</section>

</main> <!-- /main -->
Expand Down
Loading

0 comments on commit 3530a81

Please sign in to comment.