You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemml.apache.org by GitBox <gi...@apache.org> on 2020/06/03 04:16:17 UTC

[GitHub] [systemml] j143 commented on a change in pull request #933: [DOC] Documentation for builtin KMeans function

j143 commented on a change in pull request #933:
URL: https://github.com/apache/systemml/pull/933#discussion_r434292865



##########
File path: docs/builtins-reference.md
##########
@@ -105,9 +106,51 @@ print(toString(D))
 Note that reshape construction is not yet supported for **SPARK** execution.
 
 # DML-Bodied Built-In Functions
+# Introduction
+
+
+The DML (Declarative Machine Learning) language has built-in functions which enable access to both low- and high-level function
+
+
+
+## `KMeans`-Function
+
+The kmeans() function in R requires, at a minimum, numeric data and a number of centers (or clusters). 
+The cluster centers are pulled out by using $centers.
+
+
+
+### Usage
+```r
+kmeans(x, centers, iter.max, nstart)
+```
+
+### Arguments
+
+| Name   | Type            | Default  | Description |
+| :----  | :-------------  | -------- | :------------------------------- |
+| x      | Matrix[Numeric] | required |The input Matrix to do KMeans on..|
+|centers | Int             | -------- |The no. of cenetrs                |
+|iter.max|Int              |10        |Max no. of iterations allowed     |
+|nstart  |Int              |10        |No. of random starting positions  |
+
+
+
+### Returns
+| Type           | Description |
+| :------------- | :---------- |
+| String         | The mapping of records to centroids |
+| String         |The output matrix with the centroids |
+
+
+### Example
+
+KMeans = rand(Matrix x, centers k=0,int iter.max=25,int nstart=10)
+return(Matrix[numerical] C,Matrix[numerical] Y)

Review comment:
       1. Enclose this snippet in triple tick (```)
   
   ![image](https://user-images.githubusercontent.com/53068787/83593936-8c340000-a57b-11ea-80b7-0add1d512b35.png)
   
   

##########
File path: docs/builtins-reference.md
##########
@@ -105,9 +106,51 @@ print(toString(D))
 Note that reshape construction is not yet supported for **SPARK** execution.
 
 # DML-Bodied Built-In Functions
+# Introduction
+
+
+The DML (Declarative Machine Learning) language has built-in functions which enable access to both low- and high-level function
+
+
+
+## `KMeans`-Function
+
+The kmeans() function in R requires, at a minimum, numeric data and a number of centers (or clusters). 
+The cluster centers are pulled out by using $centers.
+
+
+
+### Usage
+```r
+kmeans(x, centers, iter.max, nstart)
+```
+
+### Arguments
+
+| Name   | Type            | Default  | Description |
+| :----  | :-------------  | -------- | :------------------------------- |
+| x      | Matrix[Numeric] | required |The input Matrix to do KMeans on..|
+|centers | Int             | -------- |The no. of cenetrs                |
+|iter.max|Int              |10        |Max no. of iterations allowed     |
+|nstart  |Int              |10        |No. of random starting positions  |
+
+
+
+### Returns
+| Type           | Description |
+| :------------- | :---------- |
+| String         | The mapping of records to centroids |
+| String         |The output matrix with the centroids |
+
+
+### Example
+
+KMeans = rand(Matrix x, centers k=0,int iter.max=25,int nstart=10)
+return(Matrix[numerical] C,Matrix[numerical] Y)

Review comment:
       2. Example in this case means `a runnable code snippet`.
   
   **For Example:** In the case of `slicefinder` function
   ![image](https://user-images.githubusercontent.com/53068787/83594375-ade1b700-a57c-11ea-8d33-530e8cc7635e.png)
   
   We can copy paste this usage code into the Colab and run it!
   
   ![image](https://user-images.githubusercontent.com/53068787/83594835-dfa74d80-a57d-11ea-9ade-6c8aa1d7377a.png)
   
   Which would give the following output:
   
   ![image](https://user-images.githubusercontent.com/53068787/83594871-fe0d4900-a57d-11ea-902a-121a36df780f.png)
   
   

##########
File path: docs/builtins-reference.md
##########
@@ -105,9 +106,51 @@ print(toString(D))
 Note that reshape construction is not yet supported for **SPARK** execution.
 
 # DML-Bodied Built-In Functions
+# Introduction
+
+
+The DML (Declarative Machine Learning) language has built-in functions which enable access to both low- and high-level function
+
+
+
+## `KMeans`-Function
+
+The kmeans() function in R requires, at a minimum, numeric data and a number of centers (or clusters). 
+The cluster centers are pulled out by using $centers.
+
+
+
+### Usage
+```r
+kmeans(x, centers, iter.max, nstart)
+```
+
+### Arguments
+
+| Name   | Type            | Default  | Description |
+| :----  | :-------------  | -------- | :------------------------------- |
+| x      | Matrix[Numeric] | required |The input Matrix to do KMeans on..|
+|centers | Int             | -------- |The no. of cenetrs                |
+|iter.max|Int              |10        |Max no. of iterations allowed     |
+|nstart  |Int              |10        |No. of random starting positions  |

Review comment:
       1. Consistency to be preferred, such as `| centers |` instead of `|centers |`.
   2. In `centers` we can replace `--` instead of --------, in Default column
   3. For values in the `Default` column let us prettify the formatting by enclosing the 10 in backtick (`)
   

##########
File path: docs/builtins-reference.md
##########
@@ -105,9 +106,51 @@ print(toString(D))
 Note that reshape construction is not yet supported for **SPARK** execution.
 
 # DML-Bodied Built-In Functions
+# Introduction
+
+
+The DML (Declarative Machine Learning) language has built-in functions which enable access to both low- and high-level function
+
+
+

Review comment:
       These lines are not required!

##########
File path: docs/builtins-reference.md
##########
@@ -105,9 +106,51 @@ print(toString(D))
 Note that reshape construction is not yet supported for **SPARK** execution.
 
 # DML-Bodied Built-In Functions
+# Introduction
+
+
+The DML (Declarative Machine Learning) language has built-in functions which enable access to both low- and high-level function
+
+
+
+## `KMeans`-Function
+
+The kmeans() function in R requires, at a minimum, numeric data and a number of centers (or clusters). 
+The cluster centers are pulled out by using $centers.
+
+
+
+### Usage
+```r
+kmeans(x, centers, iter.max, nstart)
+```
+
+### Arguments
+
+| Name   | Type            | Default  | Description |
+| :----  | :-------------  | -------- | :------------------------------- |
+| x      | Matrix[Numeric] | required |The input Matrix to do KMeans on..|
+|centers | Int             | -------- |The no. of cenetrs                |
+|iter.max|Int              |10        |Max no. of iterations allowed     |
+|nstart  |Int              |10        |No. of random starting positions  |
+
+
+
+### Returns
+| Type           | Description |
+| :------------- | :---------- |
+| String         | The mapping of records to centroids |
+| String         |The output matrix with the centroids |
+
+
+### Example
+
+KMeans = rand(Matrix x, centers k=0,int iter.max=25,int nstart=10)
+return(Matrix[numerical] C,Matrix[numerical] Y)
 
 **DML-bodied built-in functions** are written as DML-Scripts and executed as such when called.

Review comment:
       This line comes immediately after `# DML-Bodied Built-In Functions`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org