File matrix_statistic_decomposable_dense.hpp

namespace seco
template<typename LabelMatrix>
class DenseDecomposableStatisticMatrix
#include <matrix_statistic_decomposable_dense.hpp>

Implements row-wise read and write access to confusion matrices that are stored in pre-allocated C-contiguous arrays.

Template Parameters:

LabelMatrix – The type of the matrix that provides access to the labels of the training examples

Public Functions

DenseDecomposableStatisticMatrix(const LabelMatrix &labelMatrix, std::unique_ptr<BinarySparseArrayVector> majorityLabelVectorPtr, std::unique_ptr<DenseCoverageMatrix> coverageMatrixPtr)
Parameters:
  • labelMatrix – A reference to an object of template type LabelMatrix that provides access to the labels of the training examples

  • majorityLabelVectorPtr – An unique pointer to an object of type BinarySparseArrayVector that stores the predictions of the default rule

  • coverageMatrixPtr – An unique pointer to an object of template type DenseCoverageMatrix that stores how often individual examples and labels have been covered

uint32 getNumRows() const

Returns the number of rows in the matrix.

Returns:

The number of rows in the matrix

uint32 getNumCols() const

Returns the number of columns in the matrix.

Returns:

The number of columns in the matrix

View getView()

Returns a reference to the view, that provides access to the data structures this matrix is backed by.

Returns:

A reference to an object of type View

Public Members

const LabelMatrix &labelMatrix

A reference to an object of template type LabelMatrix that provides access to the labels of the training examples.

const std::unique_ptr<BinarySparseArrayVector> majorityLabelVectorPtr

An unique pointer to an object of type BinarySparseArrayVector that stores the predictions of the default rule.

std::unique_ptr<DenseCoverageMatrix> coverageMatrixPtr

An unique pointer to an object of type DenseCoverageMatrix that stores how often individual examples and labels have been covered.

struct View
#include <matrix_statistic_decomposable_dense.hpp>

A view that provides access to the data structures, a DenseDecomposableStatisticMatrix is backed by.

Public Functions

inline View(const LabelMatrix &labelMatrix, const BinarySparseArrayVector &majorityLabelVector, DenseCoverageMatrix &coverageMatrix)
Parameters:
  • labelMatrix – A reference to an object of template type LabelMatrix that provides access to the labels of the training examples

  • majorityLabelVector – A reference to an object of type BinarySparseArrayVector that stores the predictions of the default rule

  • coverageMatrix – A reference to an object of type DenseCoverageMatrix that stores how often individual examples and labels have been covered

Public Members

const LabelMatrix &labelMatrix

A reference to an object of template type LabelMatrix that provides access to the labels of the training examples.

const BinarySparseArrayVector &majorityLabelVector

A reference to an object of type BinarySparseArrayVector that stores the predictions of the default rule.

DenseCoverageMatrix &coverageMatrix

A reference to an object of template type DenseCoverageMatrix that stores how often individual examples and labels have been covered.