3 #ifndef FORPY_DATA_PROVIDERS_IDATAPROVIDER_H_ 4 #define FORPY_DATA_PROVIDERS_IDATAPROVIDER_H_ 7 #include "../util/serialization/basics.h" 13 #include "../util/storage.h" 32 virtual std::vector<id_t> &get_initial_sample_list()
71 virtual std::shared_ptr<const std::vector<float>>
get_weights() const
97 virtual std::vector<std::shared_ptr<IDataProvider>> create_tree_providers(
99 VIRTUAL(std::vector<std::shared_ptr<IDataProvider>>);
108 const size_t &annotation_dimension);
123 template <
class Archive>
129 #endif // FORPY_DATA_PROVIDERS_IDATAPROVIDER_H_ size_t feat_vec_dim
The dimension of one feature vector.
virtual std::shared_ptr< const std::vector< float > > get_weights() const VIRTUAL_PTR
Get a pointer to the sample weights.
virtual void set_annotations(const DataStore< Mat > &new_annotations) VIRTUAL_VOID
Replace the annotations.
A data provider for the training of one tree.
size_t id_t
Element id type.
virtual Data< VecCMap > get_feature(const size_t &) const
Get the data for one feature from all samples, contiguously in memory (stride 1). ...
std::vector< std::pair< std::shared_ptr< std::vector< size_t > >, std::shared_ptr< std::vector< float > const > > > usage_map_t
Describes how each sample is used for each tree.
typename mu::variant< Empty, STOT< float >, STOT< double >, STOT< uint >, STOT< uint8_t > > Data
Storing a variant of the provided data container type.
typename mu::variant< std::shared_ptr< const STOT< float > >, std::shared_ptr< const STOT< double > >, std::shared_ptr< const STOT< uint > >, std::shared_ptr< const STOT< uint8_t > >> DataStore
Variant for storing shared_ptrs to the stored data matrix type.
virtual Data< MatCRef > get_annotations() const
Get the full annotation data (must have inner stride 1).
size_t get_annot_vec_dim() const
Get the annotation vector dimension.
IDataProvider()
Constructor solely for deserialization.
size_t annot_vec_dim
The dimension of one annotation vector.
size_t get_feat_vec_dim() const
Get the feature vector dimension.
friend class cereal::access
void serialize(Archive &ar, const uint &)
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.
Eigen::Map< const Eigen::Matrix< DT, 1, Eigen::Dynamic, Eigen::RowMajor >, Eigen::Unaligned, Eigen::InnerStride<> > VecCMap
unsigned int uint
Convenience typedef for unsigned int.