You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by ja...@apache.org on 2020/06/04 04:39:18 UTC

[systemml] branch master updated: [DOC][1/2] Documentation for builtin KMeans function

This is an automated email from the ASF dual-hosted git repository.

janardhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/systemml.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c2ec03  [DOC][1/2] Documentation for builtin KMeans function
1c2ec03 is described below

commit 1c2ec03b48734e3f79d2ea9a35aa3d2891f15b27
Author: Tarun Kumar <ku...@gmail.com>
AuthorDate: Thu Jun 4 09:52:49 2020 +0530

    [DOC][1/2] Documentation for builtin KMeans function
    
    Closes #933.
---
 dev/docs/builtins-reference.md | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/dev/docs/builtins-reference.md b/dev/docs/builtins-reference.md
index 6ca4870..4346883 100644
--- a/dev/docs/builtins-reference.md
+++ b/dev/docs/builtins-reference.md
@@ -23,6 +23,7 @@ limitations under the License.
   * [Built-In Construction Functions](#built-in-construction-functions)
     * [`tensor`-Function](#tensor-function)
   * [DML-Bodied Built-In functions](#dml-bodied-built-in-functions)
+    * [`KMeans`-Function](#KMeans-function)
     * [`lm`-Function](#lm-function)
     * [`lmDS`-Function](#lmds-function)
     * [`lmCG`-Function](#lmcg-function)
@@ -114,6 +115,32 @@ Note that reshape construction is not yet supported for **SPARK** execution.
 **DML-bodied built-in functions** are written as DML-Scripts and executed as such when called.
 
  
+## `KMeans`-Function
+
+The kmeans() implements the KMeans Clustering algorithm.
+
+### Usage
+```r
+kmeans(X = X, k = 20, runs = 10, max_iter = 5000, eps = 0.000001, is_verbose = FALSE, avg_sample_size_per_centroid = 50)
+```
+
+### Arguments
+| Name       | Type            | Default    | Description |
+| :--------- | :-------------- | :--------- | :---------- |
+| x          | Matrix[Double]  | required   | The input Matrix to do KMeans on. |
+| k          | Int             | `10`       | Number of centroids |
+| runs       | Int             | `10`       | Number of runs (with different initial centroids) |
+| max_iter   | Int             | `100`      |Max no. of iterations allowed |
+| eps        | Double          | `0.000001` | Tolerance (epsilon) for WCSS change ratio |
+| is_verbose | Boolean         |   FALSE    | do not print per-iteration stats |
+
+### Returns
+| Type   | Description |
+| :----- | :---------- |
+| String | The mapping of records to centroids |
+| String | The output matrix with the centroids |
+
+
 ## `lm`-Function
 
 The `lm`-function solves linear regression using either the **direct solve method** or the **conjugate gradient algorithm**