-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60a3cce
commit 5578af0
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
cpp/subprojects/common/include/mlrl/common/input/feature_vector_common.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* @author Michael Rapp ([email protected]) | ||
*/ | ||
#pragma once | ||
|
||
#include "mlrl/common/data/vector_dok_binary.hpp" | ||
#include "mlrl/common/input/feature_vector.hpp" | ||
|
||
#include <memory> | ||
|
||
/** | ||
* An abstract base class for all feature vectors that store the values of training examples for a certain feature. It | ||
* allows to keep track of the indices of examples with missing feature values. | ||
*/ | ||
class AbstractFeatureVector : public IFeatureVector { | ||
private: | ||
|
||
BinaryDokVector missingIndices_; | ||
|
||
public: | ||
|
||
virtual ~AbstractFeatureVector() override {}; | ||
|
||
/** | ||
* An iterator that provides read-only access to the indices of examples with missing feature values. | ||
*/ | ||
typedef BinaryDokVector::index_const_iterator missing_index_const_iterator; | ||
|
||
/** | ||
* Returns a `missing_index_const_iterator` to the beginning of the indices of examples with missing feature | ||
* values. | ||
* | ||
* @return A `missing_index_const_iterator` to the beginning | ||
*/ | ||
missing_index_const_iterator missing_indices_cbegin() const; | ||
|
||
/** | ||
* Returns a `missing_index_const_iterator` to the end of the indices of examples with missing feature values. | ||
* | ||
* @return A `missing_index_const_iterator` to the end | ||
*/ | ||
missing_index_const_iterator missing_indices_cend() const; | ||
|
||
/** | ||
* Sets whether the example at a specific index is missing a feature value or not. | ||
* | ||
* @param index The index of the example | ||
* @param missing True, if the example at the given index is missing a feature value, false otherwise | ||
*/ | ||
void setMissing(uint32 index, bool missing); | ||
|
||
/** | ||
* Returns whether the example at a specific index is missing a feature value or not. | ||
* | ||
* @param index The index of the example | ||
* @return True, if the example at the given index is missing a feature value, false otherwise | ||
*/ | ||
bool isMissing(uint32 index) const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.