3 #ifndef FORPY_DATA_PROVIDERS_FASTDPROV_H_ 4 #define FORPY_DATA_PROVIDERS_FASTDPROV_H_ 10 #include "../util/checks.h" 33 const std::shared_ptr<std::vector<float>
const> &
weights_store);
49 const std::shared_ptr<std::vector<float>
const> &
weights_store);
64 [&](
const auto &new_annotations) {
annotations = *new_annotations; });
67 inline std::shared_ptr<const std::vector<float>>
get_weights()
const {
75 inline friend std::ostream &
operator<<(std::ostream &stream,
77 stream <<
"forpy::FastDProv[" <<
self.get_n_samples() <<
" samples, " 78 <<
self.get_feat_vec_dim() <<
" -> " <<
self.get_annot_vec_dim()
94 const std::shared_ptr<std::vector<float>
const> &
weights_store,
123 #endif // FORPY_DATA_PROVIDERS_FASTDPROV_H_ size_t feat_vec_dim
The dimension of one feature vector.
void checks(const Data< MatCRef > &data, const Data< MatCRef > &annotations) const
Perform all necessary checks before constructing an instance.
friend std::ostream & operator<<(std::ostream &stream, const FastDProv &self)
std::vector< std::shared_ptr< IDataProvider > > create_tree_providers(usage_map_t &usage_map)
forpy::IDataProvider function implementation.
A data provider for the training of one tree.
void init_from_arrays()
Perform the initialization once the FastDProv::data and FastDProv::annotations have been set...
Data< MatCRef > data
A reference to the data.
Data< MatCRef > annotations
A reference to the annotations.
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.
Data< VecCMap > get_feature(const size_t &) const
forpy::IDataProvider function implementation.
std::shared_ptr< std::vector< float > const > weights_store
Weight storage.
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.
DataStore< Mat > annotation_store
std::vector< id_t > & get_initial_sample_list()
forpy::IDataProvider function implementation.
std::shared_ptr< const std::vector< float > > get_weights() const
forpy::IDataProvider function implementation.
Use the provided data plain throughout the training.
DataStore< Mat > data_store
Data storage. If ownership of the data can't be shared, it is copied here.
bool operator==(const IDataProvider &rhs) const
FastDProv()
Constructor for deserialization.
size_t annot_vec_dim
The dimension of one annotation vector.
std::shared_ptr< std::vector< id_t > > training_ids
size_t get_n_samples() const
forpy::IDataProvider function implementation.
Data< MatCRef > get_annotations() const
forpy::IDataProvider function implementation.
void set_annotations(const DataStore< Mat > &new_annotation_store)
forpy::IDataProvider function implementation.