mlrl.testbed_sklearn.experiments.output.characteristics.data.matrix_output module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides classes that provide access to characteristics of values, associated with one or several outputs.

class mlrl.testbed_sklearn.experiments.output.characteristics.data.matrix_output.OutputMatrix(values)

Bases: object

Provides access to characteristics of values, associated with one or several outputs, that are stored in a numpy.ndarray, scipy.sparse.spmatrix or scipy.sparse.sparray.

property num_outputs: int

The total number of outputs.

property output_density: float

The density among the values associated with the available outputs.

property output_sparsity: float

The sparsity among the values associated with the available outputs.

mlrl.testbed_sklearn.experiments.output.characteristics.data.matrix_output.density(array) float

Calculates and returns the density of a two-dimensional array.

Parameters:

array – A numpy.ndarray or scipy.sparse.spmatrix or scipy.sparse.sparray, shape (num_rows, num_cols)

Returns:

The fraction of dense elements explicitly stored in the given array