forpy
2
|
A data provider for the training of one tree. More...
#include <idataprovider.h>
Public Member Functions | |
virtual | ~IDataProvider () |
virtual Data< VecCMap > | get_feature (const size_t &) const |
Get the data for one feature from all samples, contiguously in memory (stride 1). More... | |
virtual Data< MatCRef > | get_annotations () const |
Get the full annotation data (must have inner stride 1). More... | |
virtual void | set_annotations (const DataStore< Mat > &new_annotations) VIRTUAL_VOID |
Replace the annotations. More... | |
virtual std::shared_ptr< const std::vector< float > > | get_weights () const VIRTUAL_PTR |
Get a pointer to the sample weights. More... | |
size_t | get_feat_vec_dim () const |
Get the feature vector dimension. More... | |
size_t | get_annot_vec_dim () const |
Get the annotation vector dimension. More... | |
Public Attributes | |
virtual std::vector< std::shared_ptr< IDataProvider > > virtual create_tree_providers(usage_map_t &usage_map) VIRTUAL(std bool | operator== (const IDataProvider &rhs) const VIRTUAL(bool) |
Creates the data providers for each tree from the specified usage map. More... | |
Protected Member Functions | |
IDataProvider (const size_t &feature_dimension, const size_t &annotation_dimension) | |
Standard constructor to use for inheriting classes. More... | |
IDataProvider () | |
Constructor solely for deserialization. More... | |
Protected Attributes | |
size_t | feat_vec_dim |
The dimension of one feature vector. More... | |
size_t | annot_vec_dim |
The dimension of one annotation vector. More... | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const uint &) |
Friends | |
class | cereal::access |
A data provider for the training of one tree.
Definition at line 22 of file idataprovider.h.
|
inlinevirtual |
Definition at line 24 of file idataprovider.h.
|
explicitprotected |
Standard constructor to use for inheriting classes.
|
inlineprotected |
Constructor solely for deserialization.
Definition at line 114 of file idataprovider.h.
|
inline |
Get the annotation vector dimension.
Definition at line 82 of file idataprovider.h.
Get the full annotation data (must have inner stride 1).
Reimplemented in forpy::FastDProv.
Definition at line 49 of file idataprovider.h.
|
inline |
Get the feature vector dimension.
Definition at line 77 of file idataprovider.h.
Get the data for one feature from all samples, contiguously in memory (stride 1).
Reimplemented in forpy::FastDProv.
Definition at line 42 of file idataprovider.h.
|
virtual |
Get a pointer to the sample weights.
Can be a nullptr, in that case no weights were provided.
Reimplemented in forpy::FastDProv.
|
inlineprivate |
Definition at line 124 of file idataprovider.h.
|
virtual |
Replace the annotations.
Do not use this during ongoing training since there is no currently implemented mechanism to update the pointers to annotations in the various processing threads.
The method is currently used to store reduced class number lists for classification (see forpy::ClassificationOpt::check_annotations).
Reimplemented in forpy::FastDProv.
|
friend |
Definition at line 122 of file idataprovider.h.
|
protected |
The dimension of one annotation vector.
Definition at line 119 of file idataprovider.h.
|
protected |
The dimension of one feature vector.
Definition at line 114 of file idataprovider.h.
virtual std::vector<std::shared_ptr<IDataProvider> > virtual create_tree_providers ( usage_map_t &usage_map) VIRTUAL(std bool forpy::IDataProvider::operator==(const IDataProvider &rhs) const VIRTUAL(bool) |
Creates the data providers for each tree from the specified usage map.
This brings some tricky issues concerning data ownership in: since internally this method will construct other data providers not owning their data, this must be communicated to the user who constructed this object non-owning data. Hence, the resulting data providers must keep this object alive
if this method is called from Python, and all Python users of a data provider must keep it alive as long as they use it.
usage_map | A vector with sample_id lists. |
Definition at line 101 of file idataprovider.h.