mlrl.common.cython.label_matrix module

@author Michael Rapp (michael.rapp.ml@gmail.com)

class mlrl.common.cython.label_matrix.CContiguousLabelMatrix

Bases: RowWiseLabelMatrix

A label matrix that provides row-wise access to the labels of examples that are stored in a C-contiguous array.

class mlrl.common.cython.label_matrix.CsrLabelMatrix

Bases: RowWiseLabelMatrix

A label matrix that provides row-wise access to the labels of examples that are stored in a sparse matrix in the compressed sparse row (CSR) format.

class mlrl.common.cython.label_matrix.LabelMatrix

Bases: object

A label matrix.

get_num_cols() int

Returns the number of labels in the label matrix.

:return The number of labels

get_num_rows() int

Returns the number of examples in the label matrix.

:return The number of examples

is_sparse() bool

Returns whether the label matrix is sparse or not.

Returns:

True, if the label matrix is sparse, False otherwise

class mlrl.common.cython.label_matrix.RowWiseLabelMatrix

Bases: LabelMatrix

A label matrix that provides row-wise access to the labels of examples.

calculate_label_cardinality() float