File vector_confusion_matrix_dense.hpp¶
-
namespace seco
-
template<typename StatisticType>
class DenseConfusionMatrixVector : public ClearableViewDecorator<DenseVectorDecorator<AllocatedVector<ConfusionMatrix<StatisticType>>>>¶ - #include <vector_confusion_matrix_dense.hpp>
An one-dimensional vector that stores a fixed number of confusion matrices in a C-contiguous array.
- Template Parameters:
StatisticType – The type of the elements stored in the confusion matrices
Public Functions
-
DenseConfusionMatrixVector(uint32 numElements, bool init = false)¶
- Parameters:
numElements – The number of elements in the vector
init – True, if the elements of all confusion matrices should be value-initialized
-
DenseConfusionMatrixVector(const DenseConfusionMatrixVector &other)¶
- Parameters:
other – A reference to an object of type
DenseConfusionMatrixVectorto be copied
-
void add(const DenseConfusionMatrixVector<StatisticType> &other)¶
Adds all confusion matrix elements in another vector to this vector.
- Parameters:
other – A reference to an object of type
DenseConfusionMatrixVectorto be copied
-
void add(const DenseDecomposableStatisticMatrix<CContiguousView<const uint8>>::View &view, uint32 row, StatisticType weight = 1)¶
Adds the confusion matrix elements that correspond to an example at a specific index to this vector. The confusion matrix elements to be added are multiplied by a specific weight.
- Parameters:
view – A reference to an object of type
DenseDecomposableStatisticMatrix<CContiguousView<const uint8>>::Viewthat provides random access to the confusion matrices of the training examplesrow – The index of the row to be added to this vector
weight – The weight, the confusion matrix elements should be multiplied by
-
void add(const DenseDecomposableStatisticMatrix<BinaryCsrView>::View &view, uint32 row, StatisticType weight = 1)¶
Adds the confusion matrix elements that correspond to an example at a specific index to this vector. The confusion matrix elements to be added are multiplied by a specific weight.
- Parameters:
view – A reference to an object of type
DenseDecomposableStatisticMatrix<BinaryCsrView>::Viewthat provides random access to the confusion matrices of the training examplesrow – The index of the row to be added to this vector
weight – The weight, the confusion matrix elements should be multiplied by
-
void remove(const DenseDecomposableStatisticMatrix<CContiguousView<const uint8>>::View &view, uint32 row, StatisticType weight = 1)¶
Removes the confusion matrix elements at a specific row of a view from this vector. The confusion matrix elements to be added are multiplied by a specific weight.
- Parameters:
view – A reference to an object of type
DenseDecomposableStatisticMatrix<CContiguousView<const uint8>>::Viewthat provides random access to the confusion matrices of the training examplesrow – The index of the row to be removed from this vector
weight – The weight, the confusion matrix elements should be multiplied by
-
void remove(const DenseDecomposableStatisticMatrix<BinaryCsrView>::View &view, uint32 row, StatisticType weight = 1)¶
Removes the confusion matrix elements at a specific row of a view from this vector. The confusion matrix elements to be added are multiplied by a specific weight.
- Parameters:
view – A reference to an object of type
DenseDecomposableStatisticMatrix<BinaryCsrView>::Viewthat provides random access to the confusion matrices of the training examplesrow – The index of the row to be removed from this vector
weight – The weight, the confusion matrix elements should be multiplied by
-
void addToSubset(const DenseDecomposableStatisticMatrix<CContiguousView<const uint8>>::View &view, uint32 row, const CompleteIndexVector &indices, StatisticType weight = 1)¶
Adds certain confusion matrix elements in a specific row of a view, whose positions are given as a
CompleteIndexVector, to this vector. The confusion matrix elements to be added are multiplied by a specific weight.- Parameters:
view – A reference to an object of type
DenseDecomposableStatisticMatrix<CContiguousView<const uint8>>::Viewthat provides random access to the confusion matrices of the training examplesrow – The index of the row to be added to this vector
indices – A reference to a
CompleteIndexVectorthat provides access to the indicesweight – The weight, the confusion matrix elements should be multiplied by
-
void addToSubset(const DenseDecomposableStatisticMatrix<BinaryCsrView>::View &view, uint32 row, const CompleteIndexVector &indices, StatisticType weight = 1)¶
Adds certain confusion matrix elements in a specific row of a view, whose positions are given as a
CompleteIndexVector, to this vector. The confusion matrix elements to be added are multiplied by a specific weight.- Parameters:
view – A reference to an object of type
DenseDecomposableStatisticMatrix<BinaryCsrView>::Viewthat provides row-wise access to the labels of the training examplesrow – The index of the row to be added to this vector
indices – A reference to a
CompleteIndexVectorthat provides access to the indicesweight – The weight, the confusion matrix elements should be multiplied by
-
void addToSubset(const DenseDecomposableStatisticMatrix<CContiguousView<const uint8>>::View &view, uint32 row, const PartialIndexVector &indices, StatisticType weight = 1)¶
Adds certain confusion matrix elements in a specific row of a view, whose positions are given as a
CompleteIndexVector, to this vector. The confusion matrix elements to be added are multiplied by a specific weight.- Parameters:
view – A reference to an object of type
DenseDecomposableStatisticMatrix<CContiguousView<const uint8>>::Viewthat provides random access to the confusion matrices of the training examplesrow – The index of the row to be added to this vector
indices – A reference to a
PartialIndexVectorthat provides access to the indicesweight – The weight, the confusion matrix elements should be multiplied by
-
void addToSubset(const DenseDecomposableStatisticMatrix<BinaryCsrView>::View &view, uint32 row, const PartialIndexVector &indices, StatisticType weight = 1)¶
Adds certain confusion matrix elements in a specific row of a view, whose positions are given as a
CompleteIndexVector, to this vector. The confusion matrix elements to be added are multiplied by a specific weight.- Parameters:
view – A reference to an object of type
DenseDecomposableStatisticMatrix<BinaryCsrView>::Viewthat provides row-wise access to the labels of the training examplesrow – The index of the row to be added to this vector
indices – A reference to a
PartialIndexVectorthat provides access to the indicesweight – The weight, the confusion matrix elements should be multiplied by
-
void difference(typename View<ConfusionMatrix<StatisticType>>::const_iterator firstBegin, typename View<ConfusionMatrix<StatisticType>>::const_iterator firstEnd, const CompleteIndexVector &firstIndices, typename View<ConfusionMatrix<StatisticType>>::const_iterator secondBegin, typename View<ConfusionMatrix<StatisticType>>::const_iterator secondEnd)¶
Sets the confusion matrix elements in this vector to the difference
first - secondbetween the elements in two other vectors, considering only the elements in the first vector that correspond to the positions provided by aCompleteIndexVector.- Parameters:
firstBegin – A
const_iteratorto the beginning of the first vectorfirstEnd – A
const_iteratorto the end of the first vectorfirstIndices – A reference to an object of type
CompleteIndexVectorthat provides access to the indicessecondBegin – A
const_iteratorto the beginning of the second vectorsecondEnd – A
const_iteratorto the end of the second vector
-
void difference(typename View<ConfusionMatrix<StatisticType>>::const_iterator firstBegin, typename View<ConfusionMatrix<StatisticType>>::const_iterator firstEnd, const PartialIndexVector &firstIndices, typename View<ConfusionMatrix<StatisticType>>::const_iterator secondBegin, typename View<ConfusionMatrix<StatisticType>>::const_iterator secondEnd)¶
Sets the confusion matrix elements in this vector to the difference
first - secondbetween the elements in two other vectors, considering only the elements in the first vector that correspond to the positions provided by aPartialIndexVector.- Parameters:
firstBegin – A
const_iteratorto the beginning of the first vectorfirstEnd – A
const_iteratorto the end of the first vectorfirstIndices – A reference to an object of type
PartialIndexVectorthat provides access to the indicessecondBegin – A
const_iteratorto the beginning of the second vectorsecondEnd – A
const_iteratorto the end of the second vector
-
template<typename StatisticType>