bob.math.scatter

bob.math.scatter((object)a, (object)s) → None :

Computes the scatter matrix of a 2D array considering data is organized row-wise (each sample is a row, each feature is a column). The resulting matrix ‘s’ has to be square with extents equal to the number of columns in a.

scatter( (object)a, (object)s, (object)m) -> None :
Computes the scatter matrix of a 2D array considering data is organized row-wise (each sample is a row, each feature is a column). This variant also returns the sample means in ‘m’. The resulting arrays ‘m’ and ‘s’ have to have the correct sizes (s should be square with extents equal to the number of columns in a and m should be a 1D vector with extents equal to the number of columns in a).
scatter( (object)a) -> tuple :
Computes the scatter matrix of a 2D array considering data is organized row-wise (each sample is a row, each feature is a column). This variant returns the sample means and the scatter matrix in a tuple. If you are looking for efficiency, prefer the variants that receive the output variable as one of the input parameters. This version will allocate the resulting arrays ‘m’ and ‘s’ internally every time it is called.