File vector_statistic_decomposable_dense.hpp¶
-
namespace seco
-
template<typename StatisticType>
class DenseDecomposableStatisticVectorView : public CompositeVector<AllocatedVector<StatisticType>, AllocatedVector<StatisticType>>¶ - #include <vector_statistic_decomposable_dense.hpp>
An one-dimensional view that provides access to a fixed number of confusion matrices in a pre-allocated C-contiguous array.
- Template Parameters:
StatisticType – The type of the elements stored in the confusion matrices
Public Types
-
using statistic_type = StatisticType¶
The type of the confusion matrix elements.
-
using iterator = View<StatisticType>::iterator¶
An iterator that provides access to confusion matrix elements in the view and allows to modify them.
-
using const_iterator = View<StatisticType>::const_iterator¶
An iterator that provides read-only access to confusion matrix elements in the view.
Public Functions
-
DenseDecomposableStatisticVectorView(uint32 numElements, bool init = false)¶
- Parameters:
numElements – The number of elements in the view
init – True, if all elements in the view should be value-initialized, false otherwise
-
View<StatisticType>::const_iterator correct_indices_cbegin() const¶
Returns a
const_iteratorto the beginning of the label indices for which a rule predicts correctly.- Returns:
A
const_iteratorto the beginning of the label indices for which a rule predicts correctly
-
View<StatisticType>::const_iterator correct_indices_cend() const¶
Returns a
const_iteratorto the end of the label indices for which a rule predicts correctly.- Returns:
A
const_iteratorto the end of the label indices for which a rule predicts correctly
-
View<StatisticType>::iterator correct_indices_begin()¶
Returns an
iteratorto the beginning of the label indices for which a rule predicts correctly.- Returns:
An
iteratorto the beginning of the label indices for which a rule predicts correctly
-
View<StatisticType>::iterator correct_indices_end()¶
Returns an
iteratorto the end of the label indices for which a rule predicts correctly.- Returns:
An
iteratorto the end of the label indices for which a rule predicts correctly
-
View<StatisticType>::const_iterator incorrect_indices_cbegin() const¶
Returns a
const_iteratorto the beginning of the label indices for which a rule predicts incorrectly.- Returns:
A
const_iteratorto the beginning of the label indices for which a rule predicts incorrectly
-
View<StatisticType>::const_iterator incorrect_indices_cend() const¶
Returns a
const_iteratorto the end of the label indices for which a rule predicts incorrectly.- Returns:
A
const_iteratorto the end of the label indices for which a rule predicts incorrectly
-
View<StatisticType>::iterator incorrect_indices_begin()¶
Returns an
iteratorto the beginning of the label indices for which a rule predicts incorrectly.- Returns:
An
iteratorto the beginning of the label indices for which a rule predicts incorrectly
-
View<StatisticType>::iterator incorrect_indices_end()¶
Returns an
iteratorto the end of the label indices for which a rule predicts incorrectly.- Returns:
An
iteratorto the end of the label indices for which a rule predicts incorrectly
-
uint32 getNumElements() const¶
Returns the number of elements in the view.
- Returns:
The number of elements
-
void clear()¶
Sets all values stored in the view to zero.
-
template<typename StatisticType, typename VectorMath>
class DenseDecomposableStatisticVector : public ClearableViewDecorator<ViewDecorator<DenseDecomposableStatisticVectorView<StatisticType>>>¶ - #include <vector_statistic_decomposable_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
VectorMath – The type that implements basic operations for calculating with numerical arrays
Public Functions
-
DenseDecomposableStatisticVector(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
-
DenseDecomposableStatisticVector(const DenseDecomposableStatisticVector<StatisticType, VectorMath> &other)¶
- Parameters:
other – A reference to an object of type
DenseDecomposableStatisticVectorto be copied
-
View<StatisticType>::const_iterator correct_indices_cbegin() const¶
Returns a
const_iteratorto the beginning of the label indices for which a rule predicts correctly.- Returns:
A
const_iteratorto the beginning of the label indices for which a rule predicts correctly
-
View<StatisticType>::const_iterator correct_indices_cend() const¶
Returns a
const_iteratorto the end of the label indices for which a rule predicts correctly.- Returns:
A
const_iteratorto the end of the label indices for which a rule predicts correctly
-
View<StatisticType>::iterator correct_indices_begin()¶
Returns an
iteratorto the beginning of the label indices for which a rule predicts correctly.- Returns:
An
iteratorto the beginning of the label indices for which a rule predicts correctly
-
View<StatisticType>::iterator correct_indices_end()¶
Returns an
iteratorto the end of the label indices for which a rule predicts correctly.- Returns:
An
iteratorto the end of the label indices for which a rule predicts correctly
-
View<StatisticType>::const_iterator incorrect_indices_cbegin() const¶
Returns a
const_iteratorto the beginning of the label indices for which a rule predicts incorrectly.- Returns:
A
const_iteratorto the beginning of the label indices for which a rule predicts incorrectly
-
View<StatisticType>::const_iterator incorrect_indices_cend() const¶
Returns a
const_iteratorto the end of the label indices for which a rule predicts incorrectly.- Returns:
A
const_iteratorto the end of the label indices for which a rule predicts incorrectly
-
View<StatisticType>::iterator incorrect_indices_begin()¶
Returns an
iteratorto the beginning of the label indices for which a rule predicts incorrectly.- Returns:
An
iteratorto the beginning of the label indices for which a rule predicts incorrectly
-
View<StatisticType>::iterator incorrect_indices_end()¶
Returns an
iteratorto the end of the label indices for which a rule predicts incorrectly.- Returns:
An
iteratorto the end of the label indices for which a rule predicts incorrectly
-
uint32 getNumElements() const¶
Returns the number of elements in the view.
- Returns:
The number of elements
-
void add(const DenseDecomposableStatisticVectorView<StatisticType> &other)¶
Adds all confusion matrix elements in another vector to this vector.
- Parameters:
other – A reference to an object of type
DenseDecomposableStatisticVectorViewthat stores the confusion matrices to be added to this vector
-
void add(const SparseDecomposableStatisticView &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
SparseDecomposableStatisticViewthat provides 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 SparseDecomposableStatisticView &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
SparseDecomposableStatisticViewthat provides 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 SparseDecomposableStatisticView &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
SparseDecomposableStatisticViewthat provides 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 SparseDecomposableStatisticView &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
SparseDecomposableStatisticViewthat provides 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 difference(const DenseDecomposableStatisticVectorView<StatisticType> &first, const CompleteIndexVector &firstIndices, const DenseDecomposableStatisticVectorView<StatisticType> &second)¶
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:
first – A reference to an object of type
DenseDecomposableStatisticVectorViewthat stores the confusion matrices in the first vectorfirstIndices – A reference to an object of type
CompleteIndexVectorthat provides access to the indicessecond – A reference to an object of type
DenseDecomposableStatisticVectorViewthat stores the confusion matrices in the second vector
-
void difference(const DenseDecomposableStatisticVectorView<StatisticType> &first, const PartialIndexVector &firstIndices, const DenseDecomposableStatisticVectorView<StatisticType> &second)¶
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:
first – A reference to an object of type
DenseDecomposableStatisticVectorViewthat stores the confusion matrices in the first vectorfirstIndices – A reference to an object of type
PartialIndexVectorthat provides access to the indicessecond – A reference to an object of type
DenseDecomposableStatisticVectorViewthat stores the confusion matrices in the second vector
-
template<typename StatisticType>