Skip to content

Commit

Permalink
Merge pull request #63 from outbrain/cms
Browse files Browse the repository at this point in the history
Docs aligned with 0.96.0
  • Loading branch information
SkBlaz authored Feb 12, 2024
2 parents 2dd2d38 + 6927beb commit a179903
Show file tree
Hide file tree
Showing 8 changed files with 2,809 additions and 2,639 deletions.
670 changes: 372 additions & 298 deletions docs/outrank/algorithms/feature_ranking/ranking_mi_numba.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/outrank/algorithms/importance_estimator.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h1 class="modulename">
</span><span id="L-72"><a href="#L-72"><span class="linenos"> 72</span></a> <span class="k">return</span> <span class="n">estimate_feature_importance</span>
</span><span id="L-73"><a href="#L-73"><span class="linenos"> 73</span></a>
</span><span id="L-74"><a href="#L-74"><span class="linenos"> 74</span></a>
</span><span id="L-75"><a href="#L-75"><span class="linenos"> 75</span></a><span class="k">def</span> <span class="nf">numba_mi</span><span class="p">(</span><span class="n">vector_first</span><span class="p">,</span> <span class="n">vector_second</span><span class="p">,</span> <span class="n">heuristic</span><span class="p">):</span>
</span><span id="L-75"><a href="#L-75"><span class="linenos"> 75</span></a><span class="k">def</span> <span class="nf">numba_mi</span><span class="p">(</span><span class="n">vector_first</span><span class="p">,</span> <span class="n">vector_second</span><span class="p">,</span> <span class="n">heuristic</span><span class="p">,</span> <span class="n">mi_stratified_sampling_ratio</span><span class="p">):</span>
</span><span id="L-76"><a href="#L-76"><span class="linenos"> 76</span></a> <span class="k">if</span> <span class="n">heuristic</span> <span class="o">==</span> <span class="s1">&#39;MI-numba-randomized&#39;</span><span class="p">:</span>
</span><span id="L-77"><a href="#L-77"><span class="linenos"> 77</span></a> <span class="n">cardinality_correction</span> <span class="o">=</span> <span class="kc">True</span>
</span><span id="L-78"><a href="#L-78"><span class="linenos"> 78</span></a>
Expand All @@ -159,7 +159,7 @@ <h1 class="modulename">
</span><span id="L-82"><a href="#L-82"><span class="linenos"> 82</span></a> <span class="n">estimate_feature_importance</span> <span class="o">=</span> <span class="n">ranking_mi_numba</span><span class="o">.</span><span class="n">mutual_info_estimator_numba</span><span class="p">(</span>
</span><span id="L-83"><a href="#L-83"><span class="linenos"> 83</span></a> <span class="n">vector_first</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">int32</span><span class="p">),</span>
</span><span id="L-84"><a href="#L-84"><span class="linenos"> 84</span></a> <span class="n">vector_second</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">int32</span><span class="p">),</span>
</span><span id="L-85"><a href="#L-85"><span class="linenos"> 85</span></a> <span class="n">approximation_factor</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">(</span><span class="mf">1.0</span><span class="p">),</span>
</span><span id="L-85"><a href="#L-85"><span class="linenos"> 85</span></a> <span class="n">approximation_factor</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">(</span><span class="n">mi_stratified_sampling_ratio</span><span class="p">),</span>
</span><span id="L-86"><a href="#L-86"><span class="linenos"> 86</span></a> <span class="n">cardinality_correction</span><span class="o">=</span><span class="n">cardinality_correction</span><span class="p">,</span>
</span><span id="L-87"><a href="#L-87"><span class="linenos"> 87</span></a> <span class="p">)</span>
</span><span id="L-88"><a href="#L-88"><span class="linenos"> 88</span></a>
Expand Down Expand Up @@ -205,7 +205,7 @@ <h1 class="modulename">
</span><span id="L-128"><a href="#L-128"><span class="linenos">128</span></a>
</span><span id="L-129"><a href="#L-129"><span class="linenos">129</span></a> <span class="k">elif</span> <span class="s1">&#39;MI-numba&#39;</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">heuristic</span><span class="p">:</span>
</span><span id="L-130"><a href="#L-130"><span class="linenos">130</span></a> <span class="n">estimate_feature_importance</span> <span class="o">=</span> <span class="n">numba_mi</span><span class="p">(</span>
</span><span id="L-131"><a href="#L-131"><span class="linenos">131</span></a> <span class="n">vector_first</span><span class="p">,</span> <span class="n">vector_second</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">heuristic</span><span class="p">,</span>
</span><span id="L-131"><a href="#L-131"><span class="linenos">131</span></a> <span class="n">vector_first</span><span class="p">,</span> <span class="n">vector_second</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">heuristic</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">mi_stratified_sampling_ratio</span><span class="p">,</span>
</span><span id="L-132"><a href="#L-132"><span class="linenos">132</span></a> <span class="p">)</span>
</span><span id="L-133"><a href="#L-133"><span class="linenos">133</span></a>
</span><span id="L-134"><a href="#L-134"><span class="linenos">134</span></a> <span class="k">elif</span> <span class="n">args</span><span class="o">.</span><span class="n">heuristic</span> <span class="o">==</span> <span class="s1">&#39;AMI&#39;</span><span class="p">:</span>
Expand Down Expand Up @@ -383,13 +383,13 @@ <h1 class="modulename">
<div class="attr function">

<span class="def">def</span>
<span class="name">numba_mi</span><span class="signature pdoc-code condensed">(<span class="param"><span class="n">vector_first</span>, </span><span class="param"><span class="n">vector_second</span>, </span><span class="param"><span class="n">heuristic</span></span><span class="return-annotation">):</span></span>
<span class="name">numba_mi</span><span class="signature pdoc-code condensed">(<span class="param"><span class="n">vector_first</span>, </span><span class="param"><span class="n">vector_second</span>, </span><span class="param"><span class="n">heuristic</span>, </span><span class="param"><span class="n">mi_stratified_sampling_ratio</span></span><span class="return-annotation">):</span></span>

<label class="view-source-button" for="numba_mi-view-source"><span>View Source</span></label>

</div>
<a class="headerlink" href="#numba_mi"></a>
<div class="pdoc-code codehilite"><pre><span></span><span id="numba_mi-76"><a href="#numba_mi-76"><span class="linenos">76</span></a><span class="k">def</span> <span class="nf">numba_mi</span><span class="p">(</span><span class="n">vector_first</span><span class="p">,</span> <span class="n">vector_second</span><span class="p">,</span> <span class="n">heuristic</span><span class="p">):</span>
<div class="pdoc-code codehilite"><pre><span></span><span id="numba_mi-76"><a href="#numba_mi-76"><span class="linenos">76</span></a><span class="k">def</span> <span class="nf">numba_mi</span><span class="p">(</span><span class="n">vector_first</span><span class="p">,</span> <span class="n">vector_second</span><span class="p">,</span> <span class="n">heuristic</span><span class="p">,</span> <span class="n">mi_stratified_sampling_ratio</span><span class="p">):</span>
</span><span id="numba_mi-77"><a href="#numba_mi-77"><span class="linenos">77</span></a> <span class="k">if</span> <span class="n">heuristic</span> <span class="o">==</span> <span class="s1">&#39;MI-numba-randomized&#39;</span><span class="p">:</span>
</span><span id="numba_mi-78"><a href="#numba_mi-78"><span class="linenos">78</span></a> <span class="n">cardinality_correction</span> <span class="o">=</span> <span class="kc">True</span>
</span><span id="numba_mi-79"><a href="#numba_mi-79"><span class="linenos">79</span></a>
Expand All @@ -399,7 +399,7 @@ <h1 class="modulename">
</span><span id="numba_mi-83"><a href="#numba_mi-83"><span class="linenos">83</span></a> <span class="n">estimate_feature_importance</span> <span class="o">=</span> <span class="n">ranking_mi_numba</span><span class="o">.</span><span class="n">mutual_info_estimator_numba</span><span class="p">(</span>
</span><span id="numba_mi-84"><a href="#numba_mi-84"><span class="linenos">84</span></a> <span class="n">vector_first</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">int32</span><span class="p">),</span>
</span><span id="numba_mi-85"><a href="#numba_mi-85"><span class="linenos">85</span></a> <span class="n">vector_second</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">int32</span><span class="p">),</span>
</span><span id="numba_mi-86"><a href="#numba_mi-86"><span class="linenos">86</span></a> <span class="n">approximation_factor</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">(</span><span class="mf">1.0</span><span class="p">),</span>
</span><span id="numba_mi-86"><a href="#numba_mi-86"><span class="linenos">86</span></a> <span class="n">approximation_factor</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">(</span><span class="n">mi_stratified_sampling_ratio</span><span class="p">),</span>
</span><span id="numba_mi-87"><a href="#numba_mi-87"><span class="linenos">87</span></a> <span class="n">cardinality_correction</span><span class="o">=</span><span class="n">cardinality_correction</span><span class="p">,</span>
</span><span id="numba_mi-88"><a href="#numba_mi-88"><span class="linenos">88</span></a> <span class="p">)</span>
</span><span id="numba_mi-89"><a href="#numba_mi-89"><span class="linenos">89</span></a>
Expand Down Expand Up @@ -475,7 +475,7 @@ <h1 class="modulename">
</span><span id="get_importances_estimate_pairwise-129"><a href="#get_importances_estimate_pairwise-129"><span class="linenos">129</span></a>
</span><span id="get_importances_estimate_pairwise-130"><a href="#get_importances_estimate_pairwise-130"><span class="linenos">130</span></a> <span class="k">elif</span> <span class="s1">&#39;MI-numba&#39;</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">heuristic</span><span class="p">:</span>
</span><span id="get_importances_estimate_pairwise-131"><a href="#get_importances_estimate_pairwise-131"><span class="linenos">131</span></a> <span class="n">estimate_feature_importance</span> <span class="o">=</span> <span class="n">numba_mi</span><span class="p">(</span>
</span><span id="get_importances_estimate_pairwise-132"><a href="#get_importances_estimate_pairwise-132"><span class="linenos">132</span></a> <span class="n">vector_first</span><span class="p">,</span> <span class="n">vector_second</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">heuristic</span><span class="p">,</span>
</span><span id="get_importances_estimate_pairwise-132"><a href="#get_importances_estimate_pairwise-132"><span class="linenos">132</span></a> <span class="n">vector_first</span><span class="p">,</span> <span class="n">vector_second</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">heuristic</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">mi_stratified_sampling_ratio</span><span class="p">,</span>
</span><span id="get_importances_estimate_pairwise-133"><a href="#get_importances_estimate_pairwise-133"><span class="linenos">133</span></a> <span class="p">)</span>
</span><span id="get_importances_estimate_pairwise-134"><a href="#get_importances_estimate_pairwise-134"><span class="linenos">134</span></a>
</span><span id="get_importances_estimate_pairwise-135"><a href="#get_importances_estimate_pairwise-135"><span class="linenos">135</span></a> <span class="k">elif</span> <span class="n">args</span><span class="o">.</span><span class="n">heuristic</span> <span class="o">==</span> <span class="s1">&#39;AMI&#39;</span><span class="p">:</span>
Expand Down
2 changes: 2 additions & 0 deletions docs/outrank/algorithms/sketches.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

<h2>Submodules</h2>
<ul>
<li><a href="sketches/counting_cms.html">counting_cms</a></li>
<li><a href="sketches/counting_counters_ordinary.html">counting_counters_ordinary</a></li>
<li><a href="sketches/counting_ultiloglog.html">counting_ultiloglog</a></li>
</ul>

Expand Down
Loading

0 comments on commit a179903

Please sign in to comment.