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/08 08:24:06 UTC

[systemml] branch master updated: [DOC] Documentation for builtin gridSearch 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 898b8c5  [DOC] Documentation for builtin gridSearch function
898b8c5 is described below

commit 898b8c56194f8c98b19187449869945ceffe451b
Author: Karishma Sinha <3s...@gmail.com>
AuthorDate: Mon Jun 8 13:48:33 2020 +0530

    [DOC] Documentation for builtin gridSearch function
    
    Closes #950.
---
 dev/docs/builtins-reference.md | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/dev/docs/builtins-reference.md b/dev/docs/builtins-reference.md
index 83fcd10..dca37e5 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)
+    * [`gridSearch`-Function](#gridSearch-function)
     * [`KMeans`-Function](#KMeans-function)
     * [`lm`-Function](#lm-function)
     * [`lmDS`-Function](#lmds-function)
@@ -118,7 +119,43 @@ 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.
 
- 
+
+## `gridSearch`-Function
+
+The `gridSearch`-function is used to find the optimal hyper-parameters of a model which results in the most _accurate_
+predictions. This function takes `train` and `eval` functions by name. 
+
+### Usage
+```r
+gridSearch(X, y, train, predict, params, paramValues, verbose)
+```
+
+### Arguments
+| Name         | Type           | Default  | Description |
+| :------      | :------------- | -------- | :---------- |
+| X            | Matrix[Double] | required | Input Matrix of vectors. |
+| y            | Matrix[Double] | required | Input Matrix of vectors. |
+| train        | String         | required | Specified training function. |
+| predict      | String         | required | Evaluation based function. |
+| params       | List[String]   | required | List of parameters |
+| paramValues  | List[Unknown]  | required | Range of values for the parameters |
+| verbose      | Boolean        | `TRUE`   | If `TRUE` print messages are activated |
+
+### Returns
+| Type           | Description |
+| :------------- | :---------- |
+| Matrix[Double] | Parameter combination |
+| Frame[Unknown] | Best results model |
+
+### Example
+```r
+X = rand (rows = 50, cols = 10)
+y = X %*% rand(rows = ncol(X), cols = 1)
+params = list("reg", "tol", "maxi")
+paramRanges = list(10^seq(0,-4), 10^seq(-5,-9), 10^seq(1,3))
+[B, opt]= gridSearch(X=X, y=y, train="lm", predict="lmPredict", params=params, paramValues=paramRanges, verbose = TRUE)
+```
+
 ## `KMeans`-Function
 
 The kmeans() implements the KMeans Clustering algorithm.