This is an automated email from the ASF dual-hosted git repository.
mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git
The following commit(s) were added to refs/heads/main by this push:
new 04e1e61a3a [MINOR] Added missing builtin functions docs to dml
language reference
04e1e61a3a is described below
commit 04e1e61a3ad2d6dd48e92c04fb44fe3b0eb107ad
Author: Matthias Boehm <[email protected]>
AuthorDate: Wed Jun 7 20:59:19 2023 +0200
[MINOR] Added missing builtin functions docs to dml language reference
* Builtin functions added: isNA, isNaN, isInf, contains, inv
* Alternative name isInf for is.infinity for consistency with isNA and
isNaN
---
docs/site/dml-language-reference.md | 5 +++++
src/main/java/org/apache/sysds/common/Builtins.java | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/docs/site/dml-language-reference.md
b/docs/site/dml-language-reference.md
index 3eeda3fca6..ad34b7761f 100644
--- a/docs/site/dml-language-reference.md
+++ b/docs/site/dml-language-reference.md
@@ -663,6 +663,9 @@ upper.tri() | Selects the upper triangular part of a
matrix, configurable to inc
Function | Description | Parameters | Example
-------- | ----------- | ---------- | -------
+is.na() | Computes a boolean indicator matrix of the same shape as the input,
indicating where NA (not available) values are located. Currently NA is only
capturing NaN values. Alternative name: isNA() | Input: <matrix>,<br/>
Output: boolean <matrix> | isNA(X)
+is.nan() | Computes a boolean indicator matrix of the same shape as the input,
indicating where NaN (not a number) values are located. Alternative name:
isNaN() | Input: <matrix>,<br/> Output: boolean <matrix> | isNaN(X)
+is.infinite() | Computes a boolean indicator matrix of the same shape as the
input, indicating where Inf (positive or negative infinity) values are located.
Alternative name: isInf() | Input: <matrix>,<br/> Output: boolean
<matrix> | isInf(X)
pmin() <br/> pmax() | "parallel min/max".<br/> Return cell-wise
minimum/maximum. If the second input is a scalar then it is compared against
all cells in the first input. | Input: (<matrix>, <matrix>), or
(<matrix>, <scalar>) <br/> Output: matrix | pmin(X,Y) <br/>
pmax(X,y)
rowIndexMax() | Row-wise computation -- for each row, find the max value, and
return its column index. | Input: (matrix) <br/> Output: (n x 1) matrix |
rowIndexMax(X)
rowIndexMin() | Row-wise computation -- for each row, find the minimum value,
and return its column index. | Input: (matrix) <br/> Output: (n x 1) matrix |
rowIndexMin(X)
@@ -690,6 +693,7 @@ var() <br/> sd() | Return the variance/stdDev value of all
cells in matrix. Both
moment() | Returns the kth central moment of values in a column matrix V,
where k = 2, 3, or 4. It can be used to compute statistical measures like
Variance, Kurtosis, and Skewness. This function also takes an optional weights
parameter W. | Input: (X <(n x 1) matrix>, [W <(n x 1) matrix>),] k
<scalar>) <br/> Output: <scalar> | A = rand(rows=100000,cols=1,
pdf="normal") <br/> print("Variance from our (standard normal) random generator
is approximately " + moment(A,2))
colSums() <br/> colMeans() <br/> colVars() <br/> colSds() <br/> colMaxs()
<br/> colMins() | Column-wise computations -- for each column, compute the
sum/mean/variance/stdDev/max/min of cell values | Input: matrix <br/> Output:
(1 x n) matrix | colSums(X) <br/> colMeans(X) <br/> colVars(X) <br/> colSds(X)
<br/> colMaxs(X) <br/>colMins(X)
cov() | Returns the covariance between two 1-dimensional column matrices X and
Y. The function takes an optional weights parameter W. All column matrices X,
Y, and W (when specified) must have the exact same dimension. | Input: (X
<(n x 1) matrix>, Y <(n x 1) matrix> [, W <(n x 1) matrix>)])
<br/> Output: <scalar> | cov(X,Y) <br/> cov(X,Y,W)
+contains() | Indicates if the target matrix contains at least one pattern
value (with handling of special values like Not-a-Number). | Input:
(target=<matrix>,pattern=<scalar>)<br/> Output: <scalar> |
hasNaNs = contains(target=X, pattern=NaN)
table() | Returns the contingency table of two vectors A and B. The resulting
table F consists of max(A) rows and max(B) columns. <br/> More precisely,
F[i,j] = \\|{ k \\| A[k] = i and B[k] = j, 1 ≤ k ≤ n }\\|, where A and B are
two n-dimensional vectors. <br/> This function supports multiple other
variants, which can be found below, at the end of this Table 7. | Input:
(<(n x 1) matrix>, <(n x 1) matrix>), [<(n x 1) matrix>])
<br/> Output: <matrix> | F = table(A, [...]
cdf()<br/> pnorm()<br/> pexp()<br/> pchisq()<br/> pf()<br/> pt()<br/>
icdf()<br/> qnorm()<br/> qexp()<br/> qchisq()<br/> qf()<br/> qt() |
p=cdf(target=q, ...) returns the cumulative probability P[X <= q]. <br/>
q=icdf(target=p, ...) returns the inverse cumulative probability i.e., it
returns q such that the given target p = P[X<=q]. <br/> For more details,
please see the section "Probability Distribution Functions" below Table 7. |
Input: (target=<scalar>, dist="...", ...) <b [...]
aggregate() | Splits/groups the values from X according to the corresponding
values from G, and then applies the function fn on each group. <br/> The result
F is a column matrix, in which each row contains the value computed from a
distinct group in G. More specifically, F[k,1] = fn( {X[i,1] \\| 1<=i<=n
and G[i,1] = k} ), where n = nrow(X) = nrow(G). <br/> Note that the distinct
values in G are used as row indexes in the result matrix F. Therefore, nrow(F)
= max(G). It is thus reco [...]
@@ -841,6 +845,7 @@ Function | Description | Parameters | Example
cholesky() | Computes the Cholesky decomposition of symmetric input matrix A |
Input: (A <matrix>) <br/> Output: <matrix> | <span
style="white-space: nowrap;">A = matrix("4 12 -16 12 37 -43</span> -16 -43 98",
rows=3, cols=3) <br/> B = cholesky(A)<br/> Matrix B: [[2, 0, 0], [6, 1, 0],
[-8, 5, 3]]
diag() | Create diagonal matrix from (n x 1) matrix, or take diagonal from
square matrix | Input: (n x 1) matrix, or (n x n) matrix <br/> Output: (n x n)
matrix, or (n x 1) matrix | D = diag(matrix(1.0, rows=3, cols=1))<br/> E =
diag(matrix(1.0, rows=3, cols=3))
eigen() | Computes Eigen decomposition of input matrix A. The Eigen
decomposition consists of two matrices V and w such that A = V %\*% diag(w)
%\*% t(V). The columns of V are the eigenvectors of the original matrix A. And,
the eigen values are given by w. <br/> It is important to note that this
function can operate only on small-to-medium sized input matrix that can fit in
the main memory. For larger matrices, an out-of-memory exception is raised. |
Input : (A <matrix>) <br/> Outp [...]
+inv() | Computes the inverse of a squared matrix. Alternative name: inverse()
| Input: <matrix><br/> Output: <matrix> | B = inv(A)
lu() | Computes Pivoted LU decomposition of input matrix A. The LU
decomposition consists of three matrices P, L, and U such that P %\*% A = L
%\*% U, where P is a permutation matrix that is used to rearrange the rows in A
before the decomposition can be computed. L is a lower-triangular matrix
whereas U is an upper-triangular matrix. <br/> It is important to note that
this function can operate only on small-to-medium sized input matrix that can
fit in the main memory. For larger matrice [...]
qr() | Computes QR decomposition of input matrix A using Householder
reflectors. The QR decomposition of A consists of two matrices Q and R such
that A = Q%\*%R where Q is an orthogonal matrix (i.e., Q%\*%t(Q) = t(Q)%\*%Q =
I, identity matrix) and R is an upper triangular matrix. For efficiency
purposes, this function returns the matrix of Householder reflector vectors H
instead of Q (which is a large m x m potentially dense matrix). The Q matrix
can be explicitly computed from H, if nee [...]
solve() | Computes the least squares solution for system of linear equations A
%\*% x = b i.e., it finds x such that \|\|A%*%x – b\|\| is minimized. The
solution vector x is computed using a QR decomposition of A. <br/> It is
important to note that this function can operate only on small-to-medium sized
input matrix that can fit in the main memory. For larger matrices, an
out-of-memory exception is raised. | Input : (A <(m x n) matrix>, b
<(m x 1) matrix>) <br/> Output : < [...]
diff --git a/src/main/java/org/apache/sysds/common/Builtins.java
b/src/main/java/org/apache/sysds/common/Builtins.java
index efb260360e..883e57aa22 100644
--- a/src/main/java/org/apache/sysds/common/Builtins.java
+++ b/src/main/java/org/apache/sysds/common/Builtins.java
@@ -180,7 +180,7 @@ public enum Builtins {
IQM("interQuartileMean", false),
ISNA("is.na", "isNA", false),
ISNAN("is.nan", "isNaN", false),
- ISINF("is.infinite", false),
+ ISINF("is.infinite", "isInf", false),
KM("km", true),
KMEANS("kmeans", true),
KMEANSPREDICT("kmeansPredict", true),