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:08:35 UTC

[systemml] branch master updated: [DOC] Documentation for builtin naivebayes 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 13a2363  [DOC] Documentation for builtin naivebayes function
13a2363 is described below

commit 13a2363d7cae753d79cc8ec6c3bf9823d646189c
Author: Parul Damalu <po...@gmail.com>
AuthorDate: Mon Jun 8 13:31:40 2020 +0530

    [DOC] Documentation for builtin naivebayes function
    
    Closes #948.
---
 dev/docs/builtins-reference.md | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/dev/docs/builtins-reference.md b/dev/docs/builtins-reference.md
index c8fb028..83fcd10 100644
--- a/dev/docs/builtins-reference.md
+++ b/dev/docs/builtins-reference.md
@@ -35,6 +35,7 @@ limitations under the License.
     * [`normalize`-Function](#normalize-function)
     * [`gnmf`-Function](#gnmf-function)
     * [`msvm`-Function](#msvm-function)
+    * [`naivebayes`-Function](#naivebayes-function)
     * [`outlier`-Function](#outlier-function)
     * [`toOneHot`-Function](#toOneHOt-function)
     
@@ -480,6 +481,36 @@ H = rand(rows = 2, cols = ncol(X), min = -0.05, max = 0.05);
 gnmf(X = X, rnk = 2, eps = 10^-8, maxi = 10)
 ```
 
+## `naivebayes`-Function
+
+The `naivebayes`-function computes the class conditional probabilities and class priors.
+
+### Usage
+```r
+naivebayes(D, C, laplace, verbose)
+```
+
+### Arguments
+| Name            | Type           | Default  | Description |
+| :------         | :------------- | -------- | :---------- |
+| D               | Matrix[Double] | required | One dimensional column matrix with N rows. |
+| C               | Matrix[Double] | required | One dimensional column matrix with N rows. |
+| Laplace         | Double         | `1`      | Any Double value. |
+| Verbose         | Boolean        | `TRUE`   | Boolean value. |
+
+### Returns
+| Type           | Description |
+| :------------- | :---------- |
+| Matrix[Double] | Class priors, One dimensional column matrix with N rows. |
+| Matrix[Double] | Class conditional probabilites, One dimensional column matrix with N rows. |
+
+### Example
+```r
+D=rand(rows=10,cols=1,min=10)
+C=rand(rows=10,cols=1,min=10)
+[prior, classConditionals] = naivebayes(D, C, laplace = 1, verbose = TRUE)
+```
+
 ## `outlier`-Function
 
 This `outlier`-function takes a matrix data set as input from where it determines which point(s)