Documentation
¶
Overview ¶
Package agg provides aggregation functions operating on IndexView indexed views of table.Table data, along with standard AggFunc functions that can be used at any level of aggregation from tensor on up.
The main functions use names to specify columns, and *Index and *Try versions are available that operate on column indexes and return errors, respectively.
See tsragg package for functions that operate directly on a tensor.Tensor without the indexview indirection.
Index ¶
- Variables
- func Count32(a []float32) float32
- func Count64(a []float64) float64
- func CountColumn(ix *table.IndexView, column string) []float64
- func CountFunc(idx int, val float64, agg float64) float64
- func CountIfColumn(ix *table.IndexView, column string, iffun IfFunc) []float64
- func CountIfIndex(ix *table.IndexView, colIndex int, iffun IfFunc) []float64
- func CountIndex(ix *table.IndexView, colIndex int) []float64
- func CountTensor(tsr tensor.Tensor) float64
- func DescAll(ix *table.IndexView) *table.Table
- func DescColumn(ix *table.IndexView, column string) *table.Table
- func DescColumnTry(ix *table.IndexView, column string) (*table.Table, error)
- func DescIndex(ix *table.IndexView, colIndex int) *table.Table
- func L1Norm32(a []float32) float32
- func L1Norm64(a []float64) float64
- func L1NormColumn(ix *table.IndexView, column string) []float64
- func L1NormFunc(idx int, val float64, agg float64) float64
- func L1NormIndex(ix *table.IndexView, colIndex int) []float64
- func L1NormTensor(tsr tensor.Tensor) float64
- func L2Norm32(a []float32) float32
- func L2Norm64(a []float64) float64
- func L2NormColumn(ix *table.IndexView, column string) []float64
- func L2NormIndex(ix *table.IndexView, colIndex int) []float64
- func L2NormTensor(tsr tensor.Tensor) float64
- func Max32(a []float32) float32
- func Max64(a []float64) float64
- func MaxAbs32(a []float32) float32
- func MaxAbs64(a []float64) float64
- func MaxAbsColumn(ix *table.IndexView, column string) []float64
- func MaxAbsFunc(idx int, val float64, agg float64) float64
- func MaxAbsIndex(ix *table.IndexView, colIndex int) []float64
- func MaxAbsTensor(tsr tensor.Tensor) float64
- func MaxColumn(ix *table.IndexView, column string) []float64
- func MaxFunc(idx int, val float64, agg float64) float64
- func MaxIndex(ix *table.IndexView, colIndex int) []float64
- func MaxIndex32(a []float32) (float32, int)
- func MaxIndex64(a []float64) (float64, int)
- func MaxTensor(tsr tensor.Tensor) float64
- func Mean32(a []float32) float32
- func Mean64(a []float64) float64
- func MeanColumn(ix *table.IndexView, column string) []float64
- func MeanIndex(ix *table.IndexView, colIndex int) []float64
- func MeanTables(dts []*table.Table) *table.Table
- func MeanTensor(tsr tensor.Tensor) float64
- func MedianColumn(ix *table.IndexView, column string) []float64
- func MedianIndex(ix *table.IndexView, colIndex int) []float64
- func Min32(a []float32) float32
- func Min64(a []float64) float64
- func MinAbs32(a []float32) float32
- func MinAbs64(a []float64) float64
- func MinAbsColumn(ix *table.IndexView, column string) []float64
- func MinAbsFunc(idx int, val float64, agg float64) float64
- func MinAbsIndex(ix *table.IndexView, colIndex int) []float64
- func MinAbsTensor(tsr tensor.Tensor) float64
- func MinColumn(ix *table.IndexView, column string) []float64
- func MinFunc(idx int, val float64, agg float64) float64
- func MinIndex(ix *table.IndexView, colIndex int) []float64
- func MinIndex32(a []float32) (float32, int)
- func MinIndex64(a []float64) (float64, int)
- func MinTensor(tsr tensor.Tensor) float64
- func PctIfColumn(ix *table.IndexView, column string, iffun IfFunc) []float64
- func PctIfIndex(ix *table.IndexView, colIndex int, iffun IfFunc) []float64
- func Prod32(a []float32) float32
- func Prod64(a []float64) float64
- func ProdColumn(ix *table.IndexView, column string) []float64
- func ProdFunc(idx int, val float64, agg float64) float64
- func ProdIndex(ix *table.IndexView, colIndex int) []float64
- func ProdTensor(tsr tensor.Tensor) float64
- func PropIfColumn(ix *table.IndexView, column string, iffun IfFunc) []float64
- func PropIfIndex(ix *table.IndexView, colIndex int, iffun IfFunc) []float64
- func Q1Column(ix *table.IndexView, column string) []float64
- func Q1Index(ix *table.IndexView, colIndex int) []float64
- func Q3Column(ix *table.IndexView, column string) []float64
- func Q3Index(ix *table.IndexView, colIndex int) []float64
- func Quantiles(ix *table.IndexView, column string, qs []float64) []float64
- func QuantilesIndex(ix *table.IndexView, colIndex int, qs []float64) []float64
- func Sem32(a []float32) float32
- func Sem64(a []float64) float64
- func SemColumn(ix *table.IndexView, column string) []float64
- func SemIndex(ix *table.IndexView, colIndex int) []float64
- func SemPop32(a []float32) float32
- func SemPop64(a []float64) float64
- func SemPopColumn(ix *table.IndexView, column string) []float64
- func SemPopIndex(ix *table.IndexView, colIndex int) []float64
- func SemPopTensor(tsr tensor.Tensor) float64
- func SemTensor(tsr tensor.Tensor) float64
- func Stat32(a []float32, stat Stats) float32
- func Stat64(a []float64, stat Stats) float64
- func StatColumn(ix *table.IndexView, column string, stat Stats) []float64
- func StatColumnTry(ix *table.IndexView, column string, stat Stats) ([]float64, error)
- func StatIndex(ix *table.IndexView, colIndex int, stat Stats) []float64
- func StatIndexFunc(ix *table.IndexView, colIndex int, ini float64, fun StatFunc) []float64
- func StatTensor(tsr tensor.Tensor, stat Stats) float64
- func Std32(a []float32) float32
- func Std64(a []float64) float64
- func StdColumn(ix *table.IndexView, column string) []float64
- func StdIndex(ix *table.IndexView, colIndex int) []float64
- func StdPop32(a []float32) float32
- func StdPop64(a []float64) float64
- func StdPopColumn(ix *table.IndexView, column string) []float64
- func StdPopIndex(ix *table.IndexView, colIndex int) []float64
- func StdPopTensor(tsr tensor.Tensor) float64
- func StdTensor(tsr tensor.Tensor) float64
- func Sum32(a []float32) float32
- func Sum64(a []float64) float64
- func SumColumn(ix *table.IndexView, column string) []float64
- func SumFunc(idx int, val float64, agg float64) float64
- func SumIndex(ix *table.IndexView, colIndex int) []float64
- func SumSq32(a []float32) float32
- func SumSq64(a []float64) float64
- func SumSqColumn(ix *table.IndexView, column string) []float64
- func SumSqIndex(ix *table.IndexView, colIndex int) []float64
- func SumSqTensor(tsr tensor.Tensor) float64
- func SumTensor(tsr tensor.Tensor) float64
- func TensorStat(tsr tensor.Tensor, ini float64, fun StatFunc) float64
- func Var32(a []float32) float32
- func Var64(a []float64) float64
- func VarColumn(ix *table.IndexView, column string) []float64
- func VarIndex(ix *table.IndexView, colIndex int) []float64
- func VarPop32(a []float32) float32
- func VarPop64(a []float64) float64
- func VarPopColumn(ix *table.IndexView, column string) []float64
- func VarPopIndex(ix *table.IndexView, colIndex int) []float64
- func VarPopTensor(tsr tensor.Tensor) float64
- func VarTensor(tsr tensor.Tensor) float64
- type IfFunc
- type IndexViewFuncColumn
- type IndexViewFuncIndex
- type StatFunc
- type Stats
Constants ¶
This section is empty.
Variables ¶
DescStats are all the standard stats
DescStatsND are all the standard stats for n-dimensional (n > 1) data -- cannot do quantiles
Functions ¶
func CountColumn ¶
CountColumn returns the count of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func CountFunc ¶
CountFunc is an StatFunc that computes number of elements (non-Null, non-NaN) Use 0 as initial value.
func CountIfColumn ¶
CountIfColumn returns the count of true return values for given IfFunc on non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value(s) is size of column cell: 1 for scalar 1D columns and N for higher-dimensional columns.
func CountIfIndex ¶
CountIfIndex returns the count of true return values for given IfFunc on non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value(s) is size of column cell: 1 for scalar 1D columns and N for higher-dimensional columns.
func CountIndex ¶
CountIndex returns the count of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func CountTensor ¶
CountTensor returns the count of non-NaN elements in given Tensor.
func DescAll ¶
DescAll returns a table of standard descriptive stats for all numeric columns in given table, operating over all non-Null, non-NaN elements in each column.
func DescColumn ¶
DescColumn returns a table of standard descriptive aggregates of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned -- use Try version for error message.
func DescColumnTry ¶
DescColumnTry returns a table of standard descriptive stats of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func DescIndex ¶
DescIndex returns a table of standard descriptive aggregates of non-Null, non-NaN elements in given IndexView indexed view of an table.Table, for given column index.
func L1NormColumn ¶
L1NormColumn returns the L1 norm (sum abs values) of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func L1NormFunc ¶
L1NormFunc is an StatFunc that computes the L1 norm: sum of absolute values use 0 as initial value.
func L1NormIndex ¶
L1NormIndex returns the L1 norm (sum abs values) of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func L1NormTensor ¶
L1NormTensor returns the L1 norm: sum of absolute values of non-NaN elements in given Tensor.
func L2Norm32 ¶
L2Norm32 computes the square-root of sum-of-squares of vector, i.e., the L2 norm. Skips NaN's. Uses optimized algorithm from BLAS that avoids numerical overflow.
func L2Norm64 ¶
L2Norm64 computes the square-root of sum-of-squares of vector, i.e., the L2 norm. Skips NaN's. Uses optimized algorithm from BLAS that avoids numerical overflow.
func L2NormColumn ¶
L2NormColumn returns the L2 norm (square root of sum-of-squares) of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func L2NormIndex ¶
L2NormIndex returns the L2 norm (square root of sum-of-squares) of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func L2NormTensor ¶
L2NormTensor returns the L2 norm: square root of sum-of-squared values of non-NaN elements in given Tensor.
func MaxAbsColumn ¶
MaxAbsColumn returns the maximum of abs of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MaxAbsFunc ¶
MaxAbsFunc is an StatFunc that computes a max aggregate. use -math.MaxFloat64 for initial agg value.
func MaxAbsIndex ¶
MaxAbsIndex returns the maximum of abs of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MaxAbsTensor ¶
MaxAbsTensor returns the maximum of non-NaN elements in given Tensor.
func MaxColumn ¶
MaxColumn returns the maximum of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MaxFunc ¶
MaxFunc is an StatFunc that computes a max aggregate. use -math.MaxFloat64 for initial agg value.
func MaxIndex ¶
MaxIndex returns the maximum of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MaxIndex32 ¶
MaxIndex32 computes the max over vector values, and returns index of max as well Skips NaN's
func MaxIndex64 ¶
MaxIndex64 computes the max over vector values, and returns index of max as well Skips NaN's
func MeanColumn ¶
MeanColumn returns the mean of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MeanIndex ¶
MeanIndex returns the mean of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MeanTables ¶
MeanTables returns an table.Table with the mean values across all float columns of the input tables, which must have the same columns but not necessarily the same number of rows.
func MeanTensor ¶
MeanTensor returns the mean of non-NaN elements in given Tensor.
func MedianColumn ¶
MedianColumn returns the median of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MedianIndex ¶
MedianIndex returns the median of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MinAbsColumn ¶
MinAbsColumn returns the minimum of abs of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MinAbsFunc ¶
MinAbsFunc is an StatFunc that computes a min aggregate. use math.MaxFloat64 for initial agg value.
func MinAbsIndex ¶
MinAbsIndex returns the minimum of abs of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MinAbsTensor ¶
MinAbsTensor returns the minimum of non-NaN elements in given Tensor.
func MinColumn ¶
MinColumn returns the minimum of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MinFunc ¶
MinFunc is an StatFunc that computes a min aggregate. use math.MaxFloat64 for initial agg value.
func MinIndex ¶
MinIndex returns the minimum of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func MinIndex32 ¶
MinIndex32 computes the min over vector values, and returns index of min as well Skips NaN's
func MinIndex64 ¶
MinIndex64 computes the min over vector values, and returns index of min as well Skips NaN's
func PctIfColumn ¶
PctIfColumn returns the percentage (0-100) of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value(s) is size of column cell: 1 for scalar 1D columns and N for higher-dimensional columns.
func PctIfIndex ¶
PctIfIndex returns the percentage (0-100) of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value(s) is size of column cell: 1 for scalar 1D columns and N for higher-dimensional columns.
func ProdColumn ¶
ProdColumn returns the product of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func ProdIndex ¶
ProdIndex returns the product of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func ProdTensor ¶
ProdTensor returns the product of non-NaN elements in given Tensor.
func PropIfColumn ¶
PropIfColumn returns the proportion (0-1) of true return values for given IfFunc on non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value(s) is size of column cell: 1 for scalar 1D columns and N for higher-dimensional columns.
func PropIfIndex ¶
PropIfIndex returns the proportion (0-1) of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value(s) is size of column cell: 1 for scalar 1D columns and N for higher-dimensional columns.
func Q1Column ¶
Q1Column returns the first quartile of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func Q1Index ¶
Q1Index returns the first quartile of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func Q3Column ¶
Q3Column returns the third quartile of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func Q3Index ¶
Q3Index returns the third quartile of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func Quantiles ¶
Quantiles returns the given quantile(s) of non-Null, non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Column must be a 1d Column -- returns nil for n-dimensional columns. qs are 0-1 values, 0 = min, 1 = max, .5 = median, etc. Uses linear interpolation. Because this requires a sort, it is more efficient to get as many quantiles as needed in one pass.
func QuantilesIndex ¶
QuantilesIndex returns the given quantile(s) of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Column must be a 1d Column -- returns nil for n-dimensional columns. qs are 0-1 values, 0 = min, 1 = max, .5 = median, etc. Uses linear interpolation. Because this requires a sort, it is more efficient to get as many quantiles as needed in one pass.
func SemColumn ¶
SemColumn returns the sample standard error of the mean of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. Sample sem is normalized by 1/(n-1) -- see SemPop version for 1/n normalization. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func SemIndex ¶
SemIndex returns the sample standard error of the mean of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Sample sem is normalized by 1/(n-1) -- see SemPop version for 1/n normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func SemPop32 ¶
SemPop32 returns the population standard error of the mean of non-NaN elements in vector.
func SemPop64 ¶
SemPop64 returns the population standard error of the mean of non-NaN elements in vector.
func SemPopColumn ¶
SemPopColumn returns the standard error of the mean of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. population sem is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func SemPopIndex ¶
SemPopIndex returns the population standard error of the mean of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. population sem is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func SemPopTensor ¶
SemPopTensor returns the population standard error of the mean of non-NaN elements in given Tensor.
func SemTensor ¶
SemTensor returns the sample standard error of the mean of non-NaN elements in given Tensor.
func Stat32 ¶
Stat32 returns statistic according to given Stats type applied to all non-NaN elements in given slice of float32
func Stat64 ¶
Stat64 returns statistic according to given Stats type applied to all non-NaN elements in given slice of float64
func StatColumn ¶
StatColumn returns IndexView statistic according to given Stats type applied to all non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value(s) is size of column cell: 1 for scalar 1D columns and N for higher-dimensional columns.
func StatColumnTry ¶
StatColumnTry returns IndexView statistic according to given Stats type applied to all non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, returns error message. Return value(s) is size of column cell: 1 for scalar 1D columns and N for higher-dimensional columns.
func StatIndex ¶
StatIndex returns IndexView statistic according to given Stats type applied to all non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value(s) is size of column cell: 1 for scalar 1D columns and N for higher-dimensional columns.
func StatIndexFunc ¶
StatIndexFunc applies given StatFunc function to each element in the given column, using float64 conversions of the values. ini is the initial value for the agg variable. Operates independently over each cell on n-dimensional columns and returns the result as a slice of values per cell.
func StatTensor ¶
StatTensor returns Tensor statistic according to given Stats type applied to all non-NaN elements in given Tensor
func StdColumn ¶
StdColumn returns the sample std deviation of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. Sample std deviation is normalized by 1/(n-1) -- see StdPop version for 1/n normalization. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func StdIndex ¶
StdIndex returns the sample std deviation of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Sample std deviation is normalized by 1/(n-1) -- see StdPop version for 1/n normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func StdPopColumn ¶
StdPopColumn returns the population std deviation of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. population std dev is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func StdPopIndex ¶
StdPopIndex returns the population std deviation of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. population std dev is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func StdPopTensor ¶
StdPopTensor returns the population standard deviation of non-NaN elements in given Tensor.
func StdTensor ¶
StdTensor returns the sample standard deviation of non-NaN elements in given Tensor.
func SumColumn ¶
SumColumn returns the sum of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func SumIndex ¶
SumIndex returns the sum of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func SumSq32 ¶
SumSq32 computes the sum-of-squares of vector. Skips NaN's. Uses optimized algorithm from BLAS that avoids numerical overflow.
func SumSq64 ¶
SumSq64 computes the sum-of-squares of vector. Skips NaN's. Uses optimized algorithm from BLAS that avoids numerical overflow.
func SumSqColumn ¶
SumSqColumn returns the sum-of-squares of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func SumSqIndex ¶
SumSqIndex returns the sum-of-squares of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func SumSqTensor ¶
SumSqTensor returns the sum-of-squares of non-NaN elements in given Tensor.
func TensorStat ¶
TensorStat applies given StatFunc function to each element in the tensor (automatically skips NaN elements), using float64 conversions of the values. ini is the initial value for the agg variable. returns final aggregate value
func VarColumn ¶
VarColumn returns the sample variance of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. Sample variance is normalized by 1/(n-1) -- see VarPop version for 1/n normalization. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func VarIndex ¶
VarIndex returns the sample variance of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. Sample variance is normalized by 1/(n-1) -- see VarPop version for 1/n normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func VarPopColumn ¶
VarPopColumn returns the population variance of non-NaN elements in given IndexView indexed view of an table.Table, for given column name. population variance is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. If name not found, nil is returned. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func VarPopIndex ¶
VarPopIndex returns the population variance of non-NaN elements in given IndexView indexed view of an table.Table, for given column index. population variance is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.
func VarPopTensor ¶
VarPopTensor returns the population variance of non-NaN elements in given Tensor.
Types ¶
type IndexViewFuncColumn ¶
IndexViewFuncColumn is a stats function operating on IndexView, taking a column name arg
type IndexViewFuncIndex ¶
IndexViewFuncIndex is a stats function operating on IndexView, taking a column index arg
type StatFunc ¶
StatFunc is an statistic function that incrementally updates agg aggregation value from each element in the tensor in turn. Returns new agg value that will be passed into next item as agg.
type Stats ¶
type Stats int32 //enums:enum
Stats is a list of different standard aggregation functions, which can be used to choose an aggregation function
const ( // count of number of elements Count Stats = iota // sum of elements Sum // product of elements Prod // minimum value Min // max maximum value Max // minimum absolute value MinAbs // maximum absolute value MaxAbs // mean mean value Mean // sample variance (squared diffs from mean, divided by n-1) Var // sample standard deviation (sqrt of Var) Std // sample standard error of the mean (Std divided by sqrt(n)) Sem // L1 Norm: sum of absolute values L1Norm // sum of squared values SumSq // L2 Norm: square-root of sum-of-squares L2Norm // population variance (squared diffs from mean, divided by n) VarPop // population standard deviation (sqrt of VarPop) StdPop // population standard error of the mean (StdPop divided by sqrt(n)) SemPop // middle value in sorted ordering Median // Q1 first quartile = 25%ile value = .25 quantile value Q1 // Q3 third quartile = 75%ile value = .75 quantile value Q3 )
const StatsN Stats = 20
StatsN is the highest valid value for type Stats, plus one.
func StatsValues ¶
func StatsValues() []Stats
StatsValues returns all possible values for the type Stats.
func (Stats) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Stats) SetString ¶
SetString sets the Stats value from its string representation, and returns an error if the string is invalid.
func (*Stats) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.