From 6df015102a810f3cf383916740dfcf87e65f6796 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Tue, 11 Aug 2020 23:40:01 -0700 Subject: [PATCH 01/10] Add spec doc --- .../statistical_reductions.md | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 spec/API_specification/statistical_reductions.md diff --git a/spec/API_specification/statistical_reductions.md b/spec/API_specification/statistical_reductions.md new file mode 100644 index 000000000..52f4682a3 --- /dev/null +++ b/spec/API_specification/statistical_reductions.md @@ -0,0 +1,43 @@ +# Statistical Reductions + +> Array API specification for statistical reductions. + +A conforming implementation of the array API standard must provide and support the following functions adhering to the following conventions. + +- Positional parameters must be [positional-only](https://www.python.org/dev/peps/pep-0570/) parameters. Positional-only parameters have no externally-usable name. When a function accepting positional-only parameters is called, positional arguments are mapped to these parameters based solely on their order. +- Optional parameters must be [keyword-only](https://www.python.org/dev/peps/pep-3102/) arguments. +- The `out` keyword argument must follow the conventions defined in :ref:`out-keyword`. +- Broadcasting semantics must follow the semantics defined in :ref:`broadcasting`. +- Unless stated otherwise, functions must support the data types defined in :ref:`data-types`. +- Unless stated otherwise, functions must adhere to the type promotion rules defined in :ref:`type-promotion`. +- Unless stated otherwise, floating-point operations must adhere to IEEE 754-2019. + + + +### # mean(x, /, *, axis=None, keepdims=False, out=None) + +Calculates the arithmetic mean of the input array `x`. + +#### Parameters + +- **x**: _<array>_ + + - input array. + +- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_ + + - axis or axes along which the mean must be computed. By default, the mean must be computed over the entire array. If a tuple of integers, the mean must be computed over multiple axes. + +- **keepdims**: _bool_ + + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array. Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must have the expected output shape. If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each computation. Default: `None`. + +#### Returns + +- **out**: _Union\[ float, <array> ]_ + + - if the arithmetic mean was computed over the entire array, the arithmetic mean; otherwise, an array containing the arithmetic means. \ No newline at end of file From 73cfa6347f118d078110cd77c6c0695e5f01e5d2 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Tue, 11 Aug 2020 23:41:43 -0700 Subject: [PATCH 02/10] Add default --- spec/API_specification/statistical_reductions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/statistical_reductions.md b/spec/API_specification/statistical_reductions.md index 52f4682a3..825671061 100644 --- a/spec/API_specification/statistical_reductions.md +++ b/spec/API_specification/statistical_reductions.md @@ -26,7 +26,7 @@ Calculates the arithmetic mean of the input array `x`. - **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_ - - axis or axes along which the mean must be computed. By default, the mean must be computed over the entire array. If a tuple of integers, the mean must be computed over multiple axes. + - axis or axes along which the mean must be computed. By default, the mean must be computed over the entire array. If a tuple of integers, the mean must be computed over multiple axes. Default: `None`. - **keepdims**: _bool_ From 70090ac760df8efde4e289216cb312899b47acbb Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 12 Aug 2020 00:13:13 -0700 Subject: [PATCH 03/10] Add min and max --- .../statistical_reductions.md | 60 ++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/spec/API_specification/statistical_reductions.md b/spec/API_specification/statistical_reductions.md index 825671061..058841d82 100644 --- a/spec/API_specification/statistical_reductions.md +++ b/spec/API_specification/statistical_reductions.md @@ -14,6 +14,34 @@ A conforming implementation of the array API standard must provide and support t +### # max(x, /, *, axis=None, keepdims=False, out=None) + +Calculates the maximum value of the input array `x`. + +#### Parameters + +- **x**: _<array>_ + + - input array. + +- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_ + + - axis or axes along which maximum values must be computed. By default, the maximum value must be computed over the entire array. If a tuple of integers, maximum values must be computed over multiple axes. Default: `None`. + +- **keepdims**: _bool_ + + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array. Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must have the expected output shape. If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each computation. Default: `None`. + +#### Returns + +- **out**: _Union\[ int, float, <array> ]_ + + - if the maximum value was computed over the entire array, the maximum value; otherwise, an array containing the maximum values. + ### # mean(x, /, *, axis=None, keepdims=False, out=None) Calculates the arithmetic mean of the input array `x`. @@ -26,7 +54,7 @@ Calculates the arithmetic mean of the input array `x`. - **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_ - - axis or axes along which the mean must be computed. By default, the mean must be computed over the entire array. If a tuple of integers, the mean must be computed over multiple axes. Default: `None`. + - axis or axes along which arithmetic means must be computed. By default, the mean must be computed over the entire array. If a tuple of integers, arithmetic means must be computed over multiple axes. Default: `None`. - **keepdims**: _bool_ @@ -40,4 +68,32 @@ Calculates the arithmetic mean of the input array `x`. - **out**: _Union\[ float, <array> ]_ - - if the arithmetic mean was computed over the entire array, the arithmetic mean; otherwise, an array containing the arithmetic means. \ No newline at end of file + - if the arithmetic mean was computed over the entire array, the arithmetic mean; otherwise, an array containing the arithmetic means. + +### # min(x, /, *, axis=None, keepdims=False, out=None) + +Calculates the minimum value of the input array `x`. + +#### Parameters + +- **x**: _<array>_ + + - input array. + +- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_ + + - axis or axes along which minimum values must be computed. By default, the minimum value must be computed over the entire array. If a tuple of integers, minimum values must be computed over multiple axes. Default: `None`. + +- **keepdims**: _bool_ + + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array. Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must have the expected output shape. If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each computation. Default: `None`. + +#### Returns + +- **out**: _Union\[ int, float, <array> ]_ + + - if the minimum value was computed over the entire array, the minimum value; otherwise, an array containing the minimum values. \ No newline at end of file From 9861a5e55d060e74d07c42d36f2d2b0b95e51191 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 12 Aug 2020 00:14:31 -0700 Subject: [PATCH 04/10] Add references --- spec/API_specification/statistical_reductions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/API_specification/statistical_reductions.md b/spec/API_specification/statistical_reductions.md index 058841d82..53fb8e849 100644 --- a/spec/API_specification/statistical_reductions.md +++ b/spec/API_specification/statistical_reductions.md @@ -30,7 +30,7 @@ Calculates the maximum value of the input array `x`. - **keepdims**: _bool_ - - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array. Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see :ref:`broadcasting`). Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. - **out**: _Optional\[ <array> ]_ @@ -58,7 +58,7 @@ Calculates the arithmetic mean of the input array `x`. - **keepdims**: _bool_ - - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array. Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see :ref:`broadcasting`). Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. - **out**: _Optional\[ <array> ]_ @@ -86,7 +86,7 @@ Calculates the minimum value of the input array `x`. - **keepdims**: _bool_ - - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array. Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see :ref:`broadcasting`). Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. - **out**: _Optional\[ <array> ]_ From 821853264ae6d5933c8170ad299729a76484bf77 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 12 Aug 2020 00:28:44 -0700 Subject: [PATCH 05/10] Add functions --- .../statistical_reductions.md | 122 +++++++++++++++++- 1 file changed, 121 insertions(+), 1 deletion(-) diff --git a/spec/API_specification/statistical_reductions.md b/spec/API_specification/statistical_reductions.md index 53fb8e849..44d272fc9 100644 --- a/spec/API_specification/statistical_reductions.md +++ b/spec/API_specification/statistical_reductions.md @@ -96,4 +96,124 @@ Calculates the minimum value of the input array `x`. - **out**: _Union\[ int, float, <array> ]_ - - if the minimum value was computed over the entire array, the minimum value; otherwise, an array containing the minimum values. \ No newline at end of file + - if the minimum value was computed over the entire array, the minimum value; otherwise, an array containing the minimum values. + +### # prod(x, /, *, axis=None, keepdims=False, out=None) + +Calculates the product of input array `x` elements. + +#### Parameters + +- **x**: _<array>_ + + - input array. + +- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_ + + - axis or axes along which products must be computed. By default, the product must be computed over the entire array. If a tuple of integers, products must be computed over multiple axes. Default: `None`. + +- **keepdims**: _bool_ + + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see :ref:`broadcasting`). Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must have the expected output shape. If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each computation. Default: `None`. + +#### Returns + +- **out**: _Union\[ int, float, <array> ]_ + + - if the product was computed over the entire array, the product; otherwise, an array containing the products. + +### # std(x, /, *, axis=None, correction=0.0, keepdims=False, out=None) + +Calculates the standard deviation of the input array `x`. + +#### Parameters + +- **x**: _<array>_ + + - input array. + +- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_ + + - axis or axes along which standard deviations must be computed. By default, the standard deviation must be computed over the entire array. If a tuple of integers, standard deviations must be computed over multiple axes. Default: `None`. + +- **correction**: _float_ + + - degrees of freedom adjustment. Setting this parameter to a value other than `0.0` has the effect of adjusting the divisor during the calculation of the standard deviation according to `N-c` where `N` corresponds to the total number of elements over which the standard deviation is computed and `c` corresponds to the provided degrees of freedom adjustment. When computing the standard deviation of a population, setting this parameter to `0.0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample standard deviation, setting this parameter to `1.0` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction). Default: `0.0`. + +- **keepdims**: _bool_ + + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see :ref:`broadcasting`). Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must have the expected output shape. If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each computation. Default: `None`. + +#### Returns + +- **out**: _Union\[ float, <array> ]_ + + - if the standard deviation was computed over the entire array, the standard deviation; otherwise, an array containing the standard deviations. + +### # sum(x, /, *, axis=None, keepdims=False, out=None) + +Calculates the sum of the input array `x`. + +#### Parameters + +- **x**: _<array>_ + + - input array. + +- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_ + + - axis or axes along which sums must be computed. By default, the sum must be computed over the entire array. If a tuple of integers, sums must be computed over multiple axes. Default: `None`. + +- **keepdims**: _bool_ + + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see :ref:`broadcasting`). Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must have the expected output shape. If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each computation. Default: `None`. + +#### Returns + +- **out**: _Union\[ int, float, <array> ]_ + + - if the sum was computed over the entire array, the sum; otherwise, an array containing the sums. + +### # var(x, /, *, axis=None, correction=0.0, keepdims=False, out=None) + +Calculates the variance of the input array `x`. + +#### Parameters + +- **x**: _<array>_ + + - input array. + +- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_ + + - axis or axes along which variances must be computed. By default, the variance must be computed over the entire array. If a tuple of integers, variances must be computed over multiple axes. Default: `None`. + +- **correction**: _float_ + + - degrees of freedom adjustment. Setting this parameter to a value other than `0.0` has the effect of adjusting the divisor during the calculation of the variance according to `N-c` where `N` corresponds to the total number of elements over which the variance is computed and `c` corresponds to the provided degrees of freedom adjustment. When computing the variance of a population, setting this parameter to `0.0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the unbiased sample variance, setting this parameter to `1.0` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction). Default: `0.0`. + +- **keepdims**: _bool_ + + - If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see :ref:`broadcasting`). Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`. + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must have the expected output shape. If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each computation. Default: `None`. + +#### Returns + +- **out**: _Union\[ float, <array> ]_ + + - if the variance was computed over the entire array, the variance; otherwise, an array containing the variances. \ No newline at end of file From dbb78a98a9d49e241025de5515b325649682fad1 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 17 Aug 2020 15:52:48 -0700 Subject: [PATCH 06/10] Rename file and update index --- spec/API_specification/index.rst | 1 + .../{statistical_reductions.md => statistical_functions.md} | 0 2 files changed, 1 insertion(+) rename spec/API_specification/{statistical_reductions.md => statistical_functions.md} (100%) diff --git a/spec/API_specification/index.rst b/spec/API_specification/index.rst index c256627b6..72aac7729 100644 --- a/spec/API_specification/index.rst +++ b/spec/API_specification/index.rst @@ -13,3 +13,4 @@ API specification broadcasting out_keyword elementwise_functions + statistical_functions diff --git a/spec/API_specification/statistical_reductions.md b/spec/API_specification/statistical_functions.md similarity index 100% rename from spec/API_specification/statistical_reductions.md rename to spec/API_specification/statistical_functions.md From af52d524ca2d63f0d5ac97c26587446b0d58733b Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 17 Aug 2020 15:54:29 -0700 Subject: [PATCH 07/10] Update wording --- spec/API_specification/statistical_functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/API_specification/statistical_functions.md b/spec/API_specification/statistical_functions.md index 44d272fc9..baab3f61a 100644 --- a/spec/API_specification/statistical_functions.md +++ b/spec/API_specification/statistical_functions.md @@ -1,6 +1,6 @@ -# Statistical Reductions +# Statistical Functions -> Array API specification for statistical reductions. +> Array API specification for statistical functions. A conforming implementation of the array API standard must provide and support the following functions adhering to the following conventions. From 40abb6f58737b6fc351a7296be70d35792848070 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 17 Aug 2020 15:58:24 -0700 Subject: [PATCH 08/10] Update to return zero-dimensional arrays instead of scalar values --- .../statistical_functions.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/API_specification/statistical_functions.md b/spec/API_specification/statistical_functions.md index baab3f61a..66846e855 100644 --- a/spec/API_specification/statistical_functions.md +++ b/spec/API_specification/statistical_functions.md @@ -38,9 +38,9 @@ Calculates the maximum value of the input array `x`. #### Returns -- **out**: _Union\[ int, float, <array> ]_ +- **out**: _<array>_ - - if the maximum value was computed over the entire array, the maximum value; otherwise, an array containing the maximum values. + - if the maximum value was computed over the entire array, a zero-dimensional array containing the maximum value; otherwise, a non-zero-dimensional array containing the maximum values. ### # mean(x, /, *, axis=None, keepdims=False, out=None) @@ -66,9 +66,9 @@ Calculates the arithmetic mean of the input array `x`. #### Returns -- **out**: _Union\[ float, <array> ]_ +- **out**: _<array>_ - - if the arithmetic mean was computed over the entire array, the arithmetic mean; otherwise, an array containing the arithmetic means. + - if the arithmetic mean was computed over the entire array, a zero-dimensional array containing the arithmetic mean; otherwise, a non-zero dimensional array containing the arithmetic means. ### # min(x, /, *, axis=None, keepdims=False, out=None) @@ -94,9 +94,9 @@ Calculates the minimum value of the input array `x`. #### Returns -- **out**: _Union\[ int, float, <array> ]_ +- **out**: _<array>_ - - if the minimum value was computed over the entire array, the minimum value; otherwise, an array containing the minimum values. + - if the minimum value was computed over the entire array, a zero-dimensional array containing the minimum value; otherwise, a non-zero dimensional array containing the minimum values. ### # prod(x, /, *, axis=None, keepdims=False, out=None) @@ -122,9 +122,9 @@ Calculates the product of input array `x` elements. #### Returns -- **out**: _Union\[ int, float, <array> ]_ +- **out**: _<array>_ - - if the product was computed over the entire array, the product; otherwise, an array containing the products. + - if the product was computed over the entire array, a zero-dimensional array containing the product; otherwise, a non-zero dimensional array containing the products. ### # std(x, /, *, axis=None, correction=0.0, keepdims=False, out=None) @@ -154,9 +154,9 @@ Calculates the standard deviation of the input array `x`. #### Returns -- **out**: _Union\[ float, <array> ]_ +- **out**: _<array>_ - - if the standard deviation was computed over the entire array, the standard deviation; otherwise, an array containing the standard deviations. + - if the standard deviation was computed over the entire array, a zero-dimensional array containing the standard deviation; otherwise, a non-zero dimensional array containing the standard deviations. ### # sum(x, /, *, axis=None, keepdims=False, out=None) @@ -182,9 +182,9 @@ Calculates the sum of the input array `x`. #### Returns -- **out**: _Union\[ int, float, <array> ]_ +- **out**: _<array>_ - - if the sum was computed over the entire array, the sum; otherwise, an array containing the sums. + - if the sum was computed over the entire array, a zero-dimensional array containing the sum; otherwise, an array containing the sums. ### # var(x, /, *, axis=None, correction=0.0, keepdims=False, out=None) @@ -214,6 +214,6 @@ Calculates the variance of the input array `x`. #### Returns -- **out**: _Union\[ float, <array> ]_ +- **out**: _<array>_ - - if the variance was computed over the entire array, the variance; otherwise, an array containing the variances. \ No newline at end of file + - if the variance was computed over the entire array, a zero-dimensional array containing the variance; otherwise, a non-zero dimensional array containing the variances. \ No newline at end of file From 3bbca2bd0b736692e4b48c3c3cace9ebe83ff8c2 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 17 Aug 2020 17:09:50 -0700 Subject: [PATCH 09/10] Update types and descriptions --- spec/API_specification/statistical_functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/API_specification/statistical_functions.md b/spec/API_specification/statistical_functions.md index 66846e855..b419ebc60 100644 --- a/spec/API_specification/statistical_functions.md +++ b/spec/API_specification/statistical_functions.md @@ -140,9 +140,9 @@ Calculates the standard deviation of the input array `x`. - axis or axes along which standard deviations must be computed. By default, the standard deviation must be computed over the entire array. If a tuple of integers, standard deviations must be computed over multiple axes. Default: `None`. -- **correction**: _float_ +- **correction**: _Union\[ int, float ]_ - - degrees of freedom adjustment. Setting this parameter to a value other than `0.0` has the effect of adjusting the divisor during the calculation of the standard deviation according to `N-c` where `N` corresponds to the total number of elements over which the standard deviation is computed and `c` corresponds to the provided degrees of freedom adjustment. When computing the standard deviation of a population, setting this parameter to `0.0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample standard deviation, setting this parameter to `1.0` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction). Default: `0.0`. + - degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the standard deviation according to `N-c` where `N` corresponds to the total number of elements over which the standard deviation is computed and `c` corresponds to the provided degrees of freedom adjustment. When computing the standard deviation of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample standard deviation, setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction). Default: `0`. - **keepdims**: _bool_ @@ -200,9 +200,9 @@ Calculates the variance of the input array `x`. - axis or axes along which variances must be computed. By default, the variance must be computed over the entire array. If a tuple of integers, variances must be computed over multiple axes. Default: `None`. -- **correction**: _float_ +- **correction**: _Union\[ int, float ]_ - - degrees of freedom adjustment. Setting this parameter to a value other than `0.0` has the effect of adjusting the divisor during the calculation of the variance according to `N-c` where `N` corresponds to the total number of elements over which the variance is computed and `c` corresponds to the provided degrees of freedom adjustment. When computing the variance of a population, setting this parameter to `0.0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the unbiased sample variance, setting this parameter to `1.0` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction). Default: `0.0`. + - degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the variance according to `N-c` where `N` corresponds to the total number of elements over which the variance is computed and `c` corresponds to the provided degrees of freedom adjustment. When computing the variance of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the unbiased sample variance, setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction). Default: `0`. - **keepdims**: _bool_ From ff52f749c097dccf2f40fcce55286f1a6ce9ea4d Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Tue, 18 Aug 2020 15:24:25 -0700 Subject: [PATCH 10/10] Add hyphen --- spec/API_specification/statistical_functions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/API_specification/statistical_functions.md b/spec/API_specification/statistical_functions.md index b419ebc60..f3cfee5a0 100644 --- a/spec/API_specification/statistical_functions.md +++ b/spec/API_specification/statistical_functions.md @@ -68,7 +68,7 @@ Calculates the arithmetic mean of the input array `x`. - **out**: _<array>_ - - if the arithmetic mean was computed over the entire array, a zero-dimensional array containing the arithmetic mean; otherwise, a non-zero dimensional array containing the arithmetic means. + - if the arithmetic mean was computed over the entire array, a zero-dimensional array containing the arithmetic mean; otherwise, a non-zero-dimensional array containing the arithmetic means. ### # min(x, /, *, axis=None, keepdims=False, out=None) @@ -96,7 +96,7 @@ Calculates the minimum value of the input array `x`. - **out**: _<array>_ - - if the minimum value was computed over the entire array, a zero-dimensional array containing the minimum value; otherwise, a non-zero dimensional array containing the minimum values. + - if the minimum value was computed over the entire array, a zero-dimensional array containing the minimum value; otherwise, a non-zero-dimensional array containing the minimum values. ### # prod(x, /, *, axis=None, keepdims=False, out=None) @@ -124,7 +124,7 @@ Calculates the product of input array `x` elements. - **out**: _<array>_ - - if the product was computed over the entire array, a zero-dimensional array containing the product; otherwise, a non-zero dimensional array containing the products. + - if the product was computed over the entire array, a zero-dimensional array containing the product; otherwise, a non-zero-dimensional array containing the products. ### # std(x, /, *, axis=None, correction=0.0, keepdims=False, out=None) @@ -156,7 +156,7 @@ Calculates the standard deviation of the input array `x`. - **out**: _<array>_ - - if the standard deviation was computed over the entire array, a zero-dimensional array containing the standard deviation; otherwise, a non-zero dimensional array containing the standard deviations. + - if the standard deviation was computed over the entire array, a zero-dimensional array containing the standard deviation; otherwise, a non-zero-dimensional array containing the standard deviations. ### # sum(x, /, *, axis=None, keepdims=False, out=None) @@ -216,4 +216,4 @@ Calculates the variance of the input array `x`. - **out**: _<array>_ - - if the variance was computed over the entire array, a zero-dimensional array containing the variance; otherwise, a non-zero dimensional array containing the variances. \ No newline at end of file + - if the variance was computed over the entire array, a zero-dimensional array containing the variance; otherwise, a non-zero-dimensional array containing the variances. \ No newline at end of file