Skip to content

Commit 0f9b4a3

Browse files
committed
[SYSTEMDS-2646] Python API PCA algorithm
This commit contains the PCA algorithm in the python API. It also contains minor modifications to KMeans documentation in Python, and an update to the Python in /docs/api/.
1 parent 8110ef9 commit 0f9b4a3

File tree

6 files changed

+176
-8
lines changed

6 files changed

+176
-8
lines changed

docs/api/python/api/operator/algorithms.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,25 @@ <h1>Algorithms<a class="headerlink" href="#algorithms" title="Permalink to this
224224
</pre></div>
225225
</div>
226226
<span class="target" id="module-systemds.operator.algorithm"></span><dl class="py function">
227+
<dt id="systemds.operator.algorithm.kmeans">
228+
<code class="sig-prename descclassname">systemds.operator.algorithm.</code><code class="sig-name descname">kmeans</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">x</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../script_building/dag.html#systemds.script_building.dag.DAGNode" title="systemds.script_building.dag.DAGNode">systemds.script_building.dag.DAGNode</a></span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">Dict<span class="p">[</span>str<span class="p">, </span>Union<span class="p">[</span>DAGNode<span class="p">, </span>str<span class="p">, </span>int<span class="p">, </span>float<span class="p">, </span>bool<span class="p">]</span><span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; systemds.operator.operation_node.OperationNode<a class="headerlink" href="#systemds.operator.algorithm.kmeans" title="Permalink to this definition"></a></dt>
229+
<dd><p>Performs KMeans on matrix input.</p>
230+
<dl class="field-list simple">
231+
<dt class="field-odd">Parameters</dt>
232+
<dd class="field-odd"><ul class="simple">
233+
<li><p><strong>x</strong> – Input dataset to perform K-Means on.</p></li>
234+
<li><p><strong>k</strong> – The number of centroids to use for the algorithm.</p></li>
235+
<li><p><strong>runs</strong> – The number of concurrent instances of K-Means to run (with different initial centroids).</p></li>
236+
<li><p><strong>max_iter</strong> – The maximum number of iterations to run the K-Means algorithm for.</p></li>
237+
<li><p><strong>eps</strong> – Tolerance for the algorithm to declare convergence using WCSS change ratio.</p></li>
238+
<li><p><strong>is_verbose</strong> – Boolean flag if the algorithm should be run in a verbose manner.</p></li>
239+
<li><p><strong>avg_sample_size_per_centroid</strong> – The average number of records per centroid in the data samples.</p></li>
240+
</ul>
241+
</dd>
242+
</dl>
243+
</dd></dl>
244+
245+
<dl class="py function">
227246
<dt id="systemds.operator.algorithm.l2svm">
228247
<code class="sig-prename descclassname">systemds.operator.algorithm.</code><code class="sig-name descname">l2svm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">x</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../script_building/dag.html#systemds.script_building.dag.DAGNode" title="systemds.script_building.dag.DAGNode">systemds.script_building.dag.DAGNode</a></span></em>, <em class="sig-param"><span class="n">y</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../script_building/dag.html#systemds.script_building.dag.DAGNode" title="systemds.script_building.dag.DAGNode">systemds.script_building.dag.DAGNode</a></span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">Dict<span class="p">[</span>str<span class="p">, </span>Union<span class="p">[</span>DAGNode<span class="p">, </span>str<span class="p">, </span>int<span class="p">, </span>float<span class="p">, </span>bool<span class="p">]</span><span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; systemds.operator.operation_node.OperationNode<a class="headerlink" href="#systemds.operator.algorithm.l2svm" title="Permalink to this definition"></a></dt>
229248
<dd><p>Perform L2SVM on matrix with labels given.</p>
@@ -259,6 +278,22 @@ <h1>Algorithms<a class="headerlink" href="#algorithms" title="Permalink to this
259278
</dl>
260279
</dd></dl>
261280

281+
<dl class="py function">
282+
<dt id="systemds.operator.algorithm.pca">
283+
<code class="sig-prename descclassname">systemds.operator.algorithm.</code><code class="sig-name descname">pca</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">x</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../script_building/dag.html#systemds.script_building.dag.DAGNode" title="systemds.script_building.dag.DAGNode">systemds.script_building.dag.DAGNode</a></span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">Dict<span class="p">[</span>str<span class="p">, </span>Union<span class="p">[</span>DAGNode<span class="p">, </span>str<span class="p">, </span>int<span class="p">, </span>float<span class="p">, </span>bool<span class="p">]</span><span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; systemds.operator.operation_node.OperationNode<a class="headerlink" href="#systemds.operator.algorithm.pca" title="Permalink to this definition"></a></dt>
284+
<dd><p>Performs PCA on the matrix input</p>
285+
<dl class="field-list simple">
286+
<dt class="field-odd">Parameters</dt>
287+
<dd class="field-odd"><ul class="simple">
288+
<li><p><strong>x</strong> – Input dataset to perform K-Means on.</p></li>
289+
<li><p><strong>K</strong> – The number of reduced dimensions.</p></li>
290+
<li><p><strong>center</strong> – Boolean specifying if the input values should be centered.</p></li>
291+
<li><p><strong>scale</strong> – Boolean specifying if the input values should be scaled.</p></li>
292+
</ul>
293+
</dd>
294+
</dl>
295+
</dd></dl>
296+
262297
</div>
263298

264299

docs/api/python/genindex.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ <h1 id="index">Index</h1>
190190
| <a href="#E"><strong>E</strong></a>
191191
| <a href="#F"><strong>F</strong></a>
192192
| <a href="#G"><strong>G</strong></a>
193+
| <a href="#K"><strong>K</strong></a>
193194
| <a href="#L"><strong>L</strong></a>
194195
| <a href="#M"><strong>M</strong></a>
195196
| <a href="#N"><strong>N</strong></a>
@@ -353,6 +354,14 @@ <h2 id="G">G</h2>
353354
</ul></td>
354355
</tr></table>
355356

357+
<h2 id="K">K</h2>
358+
<table style="width: 100%" class="indextable genindextable"><tr>
359+
<td style="width: 33%; vertical-align: top;"><ul>
360+
<li><a href="api/operator/algorithms.html#systemds.operator.algorithm.kmeans">kmeans() (in module systemds.operator.algorithm)</a>
361+
</li>
362+
</ul></td>
363+
</tr></table>
364+
356365
<h2 id="L">L</h2>
357366
<table style="width: 100%" class="indextable genindextable"><tr>
358367
<td style="width: 33%; vertical-align: top;"><ul>
@@ -447,6 +456,8 @@ <h2 id="P">P</h2>
447456
</ul></li>
448457
</ul></td>
449458
<td style="width: 33%; vertical-align: top;"><ul>
459+
<li><a href="api/operator/algorithms.html#systemds.operator.algorithm.pca">pca() (in module systemds.operator.algorithm)</a>
460+
</li>
450461
<li><a href="api/onnx_systemds/onnx_helper.html#systemds.onnx_systemds.onnx_helper.PreparedValue">PreparedValue (class in systemds.onnx_systemds.onnx_helper)</a>
451462
</li>
452463
</ul></td>

docs/api/python/objects.inv

11 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)