aGrUM 3.3.2
a C++ library for (probabilistic) graphical models
gum::learning::IBNLearner::Database Class Reference

a helper to easily read databases More...

#include <IBNLearner.h>

Collaboration diagram for gum::learning::IBNLearner::Database:
[legend]

Public Member Functions

template<GUM_Numeric GUM_SCALAR>
 Database (std::string_view filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
Constructors / Destructors
 Database (std::string_view file, const std::vector< std::string > &missing_symbols, const bool induceTypes=false)
 default constructor
 Database (const DatabaseTable &db)
 default constructor
 Database (std::string_view filename, const Database &score_database, const std::vector< std::string > &missing_symbols)
 constructor for the priors
template<GUM_Numeric GUM_SCALAR>
 Database (std::string_view filename, const gum::BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
 constructor with a BN providing the variables of interest
 Database (const Database &from)
 copy constructor
 Database (Database &&from)
 move constructor
 ~Database ()
 destructor
Operators
Database & operator= (const Database &from)
 copy operator
Database & operator= (Database &&from)
 move operator
Accessors / Modifiers
DBRowGeneratorParser & parser ()
 returns the parser for the database
const std::vector< std::size_t > & domainSizes () const
 returns the domain sizes of the variables
const std::vector< std::string > & names () const
 returns the names of the variables in the database
NodeId idFromName (std::string_view var_name) const
 returns the node id corresponding to a variable name
const std::string & nameFromId (NodeId id) const
 returns the variable name corresponding to a given node id
const DatabaseTable & databaseTable () const
 returns the internal database table
void setDatabaseWeight (const double new_weight)
 assign a weight to all the rows of the database so that the sum of their weights is equal to new_weight
const Bijection< NodeId, std::size_t > & nodeId2Columns () const
 returns the mapping between node ids and their columns in the database
const std::vector< std::string > & missingSymbols () const
 returns the set of missing symbols taken into account
std::size_t nbRows () const
 returns the number of records in the database
std::size_t size () const
 returns the number of records in the database
void setWeight (const std::size_t i, const double weight)
 sets the weight of the ith record
double weight (const std::size_t i) const
 returns the weight of the ith record
double weight () const
 returns the weight of the whole database

Protected Attributes

DatabaseTable _database_
 the database itself
DBRowGeneratorParser * _parser_ {nullptr}
 the parser used for reading the database
std::vector< std::size_t > _domain_sizes_
 the domain sizes of the variables (useful to speed-up computations)
Bijection< NodeId, std::size_t > _nodeId2cols_
 a bijection assigning to each variable name its NodeId
Size _max_threads_number_ {gum::getNumberOfThreads()}
 the max number of threads authorized
Size _min_nb_rows_per_thread_ {100}
 the minimal number of rows to parse (on average) by thread

Private Member Functions

template<GUM_Numeric GUM_SCALAR>
BayesNet< GUM_SCALAR > _BNVars_ () const

Detailed Description

a helper to easily read databases

Definition at line 138 of file IBNLearner.h.

Constructor & Destructor Documentation

◆ Database() [1/7]

gum::learning::IBNLearner::Database::Database ( std::string_view file,
const std::vector< std::string > & missing_symbols,
const bool induceTypes = false )
explicit

default constructor

Parameters
filethe name of the CSV file containing the data
missing_symbolsthe set of symbols in the CSV file that correspond to missing data
induceTypesBy default, all the values in the dataset are interpreted as "labels", i.e., as categorical values. But if some columns of the dataset have only numerical values, it would certainly be better totag them as corresponding to integer, range or continuous variables. By setting induceTypes to true, this is precisely what the BNLearner will do.

Definition at line 84 of file IBNLearner.cpp.

86 :
87 Database(IBNLearner::readFile_(filename, missing_symbols)) {
88 // if the usr wants the best translators to be inferred, just do it
89 if (induceTypes) {
90 for (const auto& [first, second]: _database_.betterTranslators()) {
91 // change the translator
92 _database_.changeTranslator(*second, first);
93 // recompute the domain size
94 _domain_sizes_[first] = second->domainSize();
95 }
96 }
97 }
void changeTranslator(DBTranslator &new_translator, std::size_t k, bool k_is_input_col=false)
change the translator of a database column
std::vector< std::pair< Idx, std::shared_ptr< DBTranslator > > > betterTranslators() const
propose a set with translators better suited for the content of the database
std::vector< std::size_t > _domain_sizes_
the domain sizes of the variables (useful to speed-up computations)
Definition IBNLearner.h:280
DatabaseTable _database_
the database itself
Definition IBNLearner.h:274
Database(std::string_view file, const std::vector< std::string > &missing_symbols, const bool induceTypes=false)
default constructor
static DatabaseTable readFile_(std::string_view filename, const std::vector< std::string > &missing_symbols)
reads a file and returns a databaseVectInRam

References Database(), gum::learning::IBNLearner::IBNLearner(), _database_, _domain_sizes_, gum::learning::DatabaseTable::betterTranslators(), gum::learning::DatabaseTable::changeTranslator(), and gum::learning::IBNLearner::readFile_().

Referenced by Database(), Database(), Database(), Database(), Database(), operator=(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Database() [2/7]

gum::learning::IBNLearner::Database::Database ( const DatabaseTable & db)
explicit

default constructor

Parameters
dban already initialized database table that is used to fill the Database

Definition at line 70 of file IBNLearner.cpp.

70 : _database_(db) {
71 // get the variables names
72 const auto& var_names = _database_.variableNames();
73 const std::size_t nb_vars = var_names.size();
74 for (auto dom: _database_.domainSizes())
75 _domain_sizes_.push_back(dom);
76 for (std::size_t i = 0; i < nb_vars; ++i) {
78 }
79
80 // create the parser
81 _parser_ = new DBRowGeneratorParser(_database_.handler(), DBRowGeneratorSet());
82 }
DBRowGeneratorParser(const typename DatabaseTable::Handler &handler, const DBRowGeneratorSet &generator_set)
default constructor
DBVector< std::size_t > domainSizes() const
returns the domain sizes of all the variables in the database table
Bijection< NodeId, std::size_t > _nodeId2cols_
a bijection assigning to each variable name its NodeId
Definition IBNLearner.h:283
DBRowGeneratorParser * _parser_
the parser used for reading the database
Definition IBNLearner.h:277
const DBVector< std::string > & variableNames() const noexcept
returns the variable names for all the columns of the database
iterator handler() const
returns a new unsafe handler pointing to the 1st record of the database
Size NodeId
Type for node ids.

References gum::learning::DBRowGeneratorParser::DBRowGeneratorParser(), _database_, _domain_sizes_, _nodeId2cols_, _parser_, gum::learning::DatabaseTable::domainSizes(), gum::learning::IDatabaseTable< T_DATA >::handler(), gum::BijectionImplementation< T1, T2, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::insert(), and gum::learning::IDatabaseTable< T_DATA >::variableNames().

Here is the call graph for this function:

◆ Database() [3/7]

gum::learning::IBNLearner::Database::Database ( std::string_view filename,
const Database & score_database,
const std::vector< std::string > & missing_symbols )

constructor for the priors

We must ensure that the variables of the Database are identical to those of the score database (else the counts used by the scores might be erroneous). However, we allow the variables to be ordered differently in the two databases: variables with the same name in both databases are supposed to be the same.

Parameters
filethe name of the CSV file containing the data
score_databasethe main database used for the learning
missing_symbolsthe set of symbols in the CSV file that correspond to missing data

Definition at line 99 of file IBNLearner.cpp.

101 {
102 // assign to each column name in the CSV file its column
103 IBNLearner::isCSVFileName_(CSV_filename);
104 DBInitializerFromCSV initializer{std::string(CSV_filename)};
105 const auto& prior_names = initializer.variableNames();
106 std::size_t prior_nb_vars = prior_names.size();
107 HashTable< std::string, std::size_t > prior_names2col(prior_nb_vars);
108 for (auto i = std::size_t(0); i < prior_nb_vars; ++i)
109 prior_names2col.insert(prior_names[i], i);
110
111 // check that there are at least as many variables in the a priori
112 // database as those in the score_database
113 if (prior_nb_vars < score_database._database_.nbVariables()) {
114 GUM_ERROR(InvalidArgument,
115 "the a prior database has fewer variables "
116 "than the observed database")
117 }
118
119 // get the mapping from the columns of score_database to those of
120 // the CSV file
121 const std::vector< std::string >& score_names = score_database.databaseTable().variableNames();
122 const std::size_t score_nb_vars = score_names.size();
123 HashTable< std::size_t, std::size_t > mapping(score_nb_vars);
124 for (auto i = std::size_t(0); i < score_nb_vars; ++i) {
125 try {
126 mapping.insert(i, prior_names2col[score_names[i]]);
127 } catch (Exception const&) {
128 GUM_ERROR(MissingVariableInDatabase,
129 "Variable " << score_names[i]
130 << " of the observed database does not belong to the "
131 << "prior database")
132 }
133 }
134
135 // create the translators for CSV database
136 for (auto i = std::size_t(0); i < score_nb_vars; ++i) {
137 const Variable& var = score_database.databaseTable().variable(i);
138 _database_.insertTranslator(var, mapping[i], missing_symbols);
139 }
140
141 // fill the database
142 initializer.fillDatabase(_database_);
143
144 // get the domain sizes of the variables
145 for (auto dom: _database_.domainSizes())
146 _domain_sizes_.push_back(dom);
147
148 // compute the mapping from node ids to column indices
149 _nodeId2cols_ = score_database.nodeId2Columns();
150
151 // create the parser
152 _parser_ = new DBRowGeneratorParser(_database_.handler(), DBRowGeneratorSet());
153 }
std::size_t insertTranslator(const DBTranslator &translator, const std::size_t input_column, const bool unique_column=true)
insert a new translator into the database table
static void isCSVFileName_(std::string_view filename)
checks whether the extension of a CSV filename is correct
#define GUM_ERROR(type, msg)
Definition exceptions.h:76

References Database(), gum::learning::DBRowGeneratorParser::DBRowGeneratorParser(), _database_, _domain_sizes_, _nodeId2cols_, _parser_, databaseTable(), gum::learning::IDBInitializer::fillDatabase(), GUM_ERROR, gum::HashTable< Key, Val >::insert(), gum::learning::IBNLearner::isCSVFileName_(), gum::learning::IDatabaseTable< T_DATA >::nbVariables(), nodeId2Columns(), gum::learning::DatabaseTable::variable(), gum::learning::IDatabaseTable< T_DATA >::variableNames(), and gum::learning::IDBInitializer::variableNames().

Here is the call graph for this function:

◆ Database() [4/7]

template<GUM_Numeric GUM_SCALAR>
gum::learning::IBNLearner::Database::Database ( std::string_view filename,
const gum::BayesNet< GUM_SCALAR > & bn,
const std::vector< std::string > & missing_symbols )

constructor with a BN providing the variables of interest

Parameters
filethe name of the CSV file containing the data
bna Bayesian network indicating which variables of the CSV file are used for learning
missing_symbolsthe set of symbols in the CSV file that correspond to missing data

References Database(), databaseTable(), domainSizes(), idFromName(), missingSymbols(), nameFromId(), names(), nbRows(), nodeId2Columns(), operator=(), parser(), setDatabaseWeight(), setWeight(), size(), and weight().

Here is the call graph for this function:

◆ Database() [5/7]

gum::learning::IBNLearner::Database::Database ( const Database & from)

copy constructor

Definition at line 155 of file IBNLearner.cpp.

155 :
156 _database_(from._database_), _domain_sizes_(from._domain_sizes_),
157 _nodeId2cols_(from._nodeId2cols_) {
158 // create the parser
159 _parser_ = new DBRowGeneratorParser(_database_.handler(), DBRowGeneratorSet());
160 }

References Database(), gum::learning::DBRowGeneratorParser::DBRowGeneratorParser(), _database_, _domain_sizes_, _nodeId2cols_, _parser_, and gum::learning::IDatabaseTable< T_DATA >::handler().

Here is the call graph for this function:

◆ Database() [6/7]

gum::learning::IBNLearner::Database::Database ( Database && from)

move constructor

Definition at line 162 of file IBNLearner.cpp.

162 :
163 _database_(std::move(from._database_)), _domain_sizes_(std::move(from._domain_sizes_)),
164 _nodeId2cols_(std::move(from._nodeId2cols_)) {
165 // create the parser
166 _parser_ = new DBRowGeneratorParser(_database_.handler(), DBRowGeneratorSet());
167 }

References Database(), gum::learning::DBRowGeneratorParser::DBRowGeneratorParser(), _database_, _domain_sizes_, _nodeId2cols_, _parser_, and gum::learning::IDatabaseTable< T_DATA >::handler().

Here is the call graph for this function:

◆ ~Database()

gum::learning::IBNLearner::Database::~Database ( )

destructor

Definition at line 169 of file IBNLearner.cpp.

169{ delete _parser_; }

References _parser_.

◆ Database() [7/7]

template<GUM_Numeric GUM_SCALAR>
gum::learning::IBNLearner::Database::Database ( std::string_view filename,
const BayesNet< GUM_SCALAR > & bn,
const std::vector< std::string > & missing_symbols )

Definition at line 51 of file IBNLearner_tpl.h.

53 {
54 // assign to each column name in the database its position
56 DBInitializerFromCSV initializer{std::string(filename)};
57 const auto& xvar_names = initializer.variableNames();
58 std::size_t nb_vars = xvar_names.size();
59 HashTable< std::string, std::size_t > var_names(nb_vars);
60 for (std::size_t i = std::size_t(0); i < nb_vars; ++i)
61 var_names.insert(xvar_names[i], i);
62
63 // we use the bn to insert the translators into the database table
64 std::vector< NodeId > nodes;
65 nodes.reserve(bn.internalDag().sizeNodes());
66 for (const auto node: bn.internalDag())
67 nodes.push_back(node);
68 std::sort(nodes.begin(), nodes.end());
69 std::size_t i = std::size_t(0);
70 for (auto node: nodes) {
71 const Variable& var = bn.variable(node);
72 auto p = var_names.tryGet(var.name());
73 if (!p) { GUM_ERROR(MissingVariableInDatabase, "Variable '" << var.name() << "' is missing") }
74 _database_.insertTranslator(var, *p, missing_symbols);
75 _nodeId2cols_.insert(NodeId(node), i++);
76 }
77
78 // fill the database
79 initializer.fillDatabase(_database_);
80
81 // get the domain sizes of the variables
82 for (auto dom: _database_.domainSizes())
83 _domain_sizes_.push_back(dom);
84
85 // create the parser
86 _parser_ = new DBRowGeneratorParser(_database_.handler(), DBRowGeneratorSet());
87 }

References gum::learning::DBRowGeneratorParser::DBRowGeneratorParser(), _database_, _domain_sizes_, _nodeId2cols_, _parser_, gum::learning::DatabaseTable::domainSizes(), gum::learning::IDBInitializer::fillDatabase(), GUM_ERROR, gum::learning::IDatabaseTable< T_DATA >::handler(), gum::BijectionImplementation< T1, T2, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::insert(), gum::HashTable< Key, Val >::insert(), gum::learning::DatabaseTable::insertTranslator(), gum::learning::IBNLearner::isCSVFileName_(), gum::Variable::name(), gum::HashTable< Key, Val >::tryGet(), and gum::learning::IDBInitializer::variableNames().

Here is the call graph for this function:

Member Function Documentation

◆ _BNVars_()

template<GUM_Numeric GUM_SCALAR>
BayesNet< GUM_SCALAR > gum::learning::IBNLearner::Database::_BNVars_ ( ) const
private

Definition at line 90 of file IBNLearner_tpl.h.

90 {
91 BayesNet< GUM_SCALAR > bn;
92 const std::size_t nb_vars = _database_.nbVariables();
93 for (std::size_t i = 0; i < nb_vars; ++i) {
94 const DiscreteVariable& var = dynamic_cast< const DiscreteVariable& >(_database_.variable(i));
95 bn.add(var);
96 }
97 return bn;
98 }
const Variable & variable(const std::size_t k, const bool k_is_input_col=false) const
returns either the kth variable of the database table or the first one corresponding to the kth colum...
std::size_t nbVariables() const noexcept
returns the number of variables (columns) of the database

References _database_.

◆ databaseTable()

◆ domainSizes()

INLINE const std::vector< std::size_t > & gum::learning::IBNLearner::Database::domainSizes ( ) const

returns the domain sizes of the variables

Definition at line 65 of file IBNLearner_inl.h.

65 {
66 return _domain_sizes_;
67 }

References _domain_sizes_.

Referenced by Database(), gum::learning::IBNLearner::domainSize(), gum::learning::IBNLearner::domainSize(), gum::learning::IBNLearner::domainSizes(), and gum::learning::IBNLearner::nbCols().

Here is the caller graph for this function:

◆ idFromName()

INLINE NodeId gum::learning::IBNLearner::Database::idFromName ( std::string_view var_name) const

returns the node id corresponding to a variable name

Definition at line 82 of file IBNLearner_inl.h.

82 {
83 try {
84 const auto cols = _database_.columnsFromVariableName(var_name);
85 return _nodeId2cols_.first(cols[0]);
86 } catch (...) {
87 GUM_ERROR(MissingVariableInDatabase,
88 "Variable " << var_name << " could not be found in the database")
89 }
90 }
DBVector< std::size_t > columnsFromVariableName(std::string_view name) const
returns the indices of all the columns whose name is passed in argument

References _database_, _nodeId2cols_, and GUM_ERROR.

Referenced by Database(), and gum::learning::IBNLearner::idFromName().

Here is the caller graph for this function:

◆ missingSymbols()

INLINE const std::vector< std::string > & gum::learning::IBNLearner::Database::missingSymbols ( ) const

returns the set of missing symbols taken into account

Definition at line 106 of file IBNLearner_inl.h.

106 {
107 return _database_.missingSymbols();
108 }
const DBVector< std::string > & missingSymbols() const
returns the set of missing symbols

References _database_.

Referenced by Database().

Here is the caller graph for this function:

◆ nameFromId()

INLINE const std::string & gum::learning::IBNLearner::Database::nameFromId ( NodeId id) const

returns the variable name corresponding to a given node id

Definition at line 93 of file IBNLearner_inl.h.

93 {
94 try {
96 } catch (...) {
97 GUM_ERROR(MissingVariableInDatabase,
98 "Variable of Id " << id << " could not be found in the database")
99 }
100 }
const std::string & variableName(const std::size_t k) const
returns the name of the kth column of the IDatabaseTable

References _database_, _nodeId2cols_, and GUM_ERROR.

Referenced by Database(), and gum::learning::IBNLearner::nameFromId().

Here is the caller graph for this function:

◆ names()

INLINE const std::vector< std::string > & gum::learning::IBNLearner::Database::names ( ) const

returns the names of the variables in the database

Definition at line 70 of file IBNLearner_inl.h.

70 {
72 }

References _database_.

Referenced by Database(), and gum::learning::IBNLearner::names().

Here is the caller graph for this function:

◆ nbRows()

INLINE std::size_t gum::learning::IBNLearner::Database::nbRows ( ) const

returns the number of records in the database

Definition at line 116 of file IBNLearner_inl.h.

116{ return _database_.nbRows(); }
std::size_t nbRows() const noexcept
returns the number of records (rows) in the database

References _database_.

Referenced by Database().

Here is the caller graph for this function:

◆ nodeId2Columns()

INLINE const Bijection< NodeId, std::size_t > & gum::learning::IBNLearner::Database::nodeId2Columns ( ) const

returns the mapping between node ids and their columns in the database

Definition at line 111 of file IBNLearner_inl.h.

111 {
112 return _nodeId2cols_;
113 }

References _nodeId2cols_.

Referenced by Database(), Database(), gum::learning::IBNLearner::createCorrectedMutualInformation_(), gum::learning::IBNLearner::createParamEstimator_(), gum::learning::IBNLearner::createScore_(), gum::learning::IBNLearner::mutualInformation(), gum::learning::IBNLearner::prepareFCI_(), and gum::learning::IBNLearner::preparePC_().

Here is the caller graph for this function:

◆ operator=() [1/2]

IBNLearner::Database & gum::learning::IBNLearner::Database::operator= ( const Database & from)

copy operator

Definition at line 171 of file IBNLearner.cpp.

171 {
172 if (this != &from) {
173 delete _parser_;
174 _database_ = from._database_;
175 _domain_sizes_ = from._domain_sizes_;
176 _nodeId2cols_ = from._nodeId2cols_;
177
178 // create the parser
179 _parser_ = new DBRowGeneratorParser(_database_.handler(), DBRowGeneratorSet());
180 }
181
182 return *this;
183 }

References Database(), gum::learning::DBRowGeneratorParser::DBRowGeneratorParser(), _database_, _domain_sizes_, _nodeId2cols_, and _parser_.

Referenced by Database().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [2/2]

IBNLearner::Database & gum::learning::IBNLearner::Database::operator= ( Database && from)

move operator

Definition at line 185 of file IBNLearner.cpp.

185 {
186 if (this != &from) {
187 delete _parser_;
188 _database_ = std::move(from._database_);
189 _domain_sizes_ = std::move(from._domain_sizes_);
190 _nodeId2cols_ = std::move(from._nodeId2cols_);
191
192 // create the parser
193 _parser_ = new DBRowGeneratorParser(_database_.handler(), DBRowGeneratorSet());
194 }
195
196 return *this;
197 }

References Database(), gum::learning::DBRowGeneratorParser::DBRowGeneratorParser(), _database_, _domain_sizes_, _nodeId2cols_, and _parser_.

Here is the call graph for this function:

◆ parser()

◆ setDatabaseWeight()

INLINE void gum::learning::IBNLearner::Database::setDatabaseWeight ( const double new_weight)

assign a weight to all the rows of the database so that the sum of their weights is equal to new_weight

assign new weight to the rows of the learning database

Definition at line 75 of file IBNLearner_inl.h.

75 {
76 if (_database_.nbRows() == std::size_t(0)) return;
77 const double weight = new_weight / double(_database_.nbRows());
79 }
double weight(const std::size_t i) const
returns the weight of the ith record
void setAllRowsWeight(const double new_weight)
assign a given weight to all the rows of the database

References _database_, and weight().

Referenced by Database(), and gum::learning::IBNLearner::setDatabaseWeight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWeight()

INLINE void gum::learning::IBNLearner::Database::setWeight ( const std::size_t i,
const double weight )

sets the weight of the ith record

Exceptions
OutOfBoundsif i is outside the set of indices of the records or if the weight is negative

Definition at line 122 of file IBNLearner_inl.h.

122 {
124 }
void setWeight(const std::size_t i, const double weight)
assigns a given weight to the ith row of the database

References _database_, and weight().

Referenced by Database(), and gum::learning::IBNLearner::setRecordWeight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

INLINE std::size_t gum::learning::IBNLearner::Database::size ( ) const

returns the number of records in the database

Definition at line 119 of file IBNLearner_inl.h.

119{ return _database_.size(); }
std::size_t size() const noexcept
returns the number of records (rows) in the database

References _database_, and gum::BijectionImplementation< T1, T2, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::size().

Referenced by Database().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ weight() [1/2]

INLINE double gum::learning::IBNLearner::Database::weight ( ) const

returns the weight of the whole database

Definition at line 132 of file IBNLearner_inl.h.

132{ return _database_.weight(); }
double weight(const std::size_t i) const
returns the weight of the ith record

References _database_.

◆ weight() [2/2]

INLINE double gum::learning::IBNLearner::Database::weight ( const std::size_t i) const

returns the weight of the ith record

Exceptions
OutOfBoundsif i is outside the set of indices of the records

Definition at line 127 of file IBNLearner_inl.h.

127 {
128 return _database_.weight(i);
129 }

References _database_.

Referenced by Database(), gum::learning::IBNLearner::correctedMutualInformation(), gum::learning::IBNLearner::databaseWeight(), gum::learning::IBNLearner::mutualInformation(), gum::learning::IBNLearner::recordWeight(), setDatabaseWeight(), and setWeight().

Here is the caller graph for this function:

Member Data Documentation

◆ _database_

DatabaseTable gum::learning::IBNLearner::Database::_database_
protected

◆ _domain_sizes_

std::vector< std::size_t > gum::learning::IBNLearner::Database::_domain_sizes_
protected

the domain sizes of the variables (useful to speed-up computations)

Definition at line 280 of file IBNLearner.h.

Referenced by Database(), Database(), Database(), Database(), Database(), Database(), domainSizes(), operator=(), and operator=().

◆ _max_threads_number_

Size gum::learning::IBNLearner::Database::_max_threads_number_ {gum::getNumberOfThreads()}
protected

the max number of threads authorized

Definition at line 286 of file IBNLearner.h.

◆ _min_nb_rows_per_thread_

Size gum::learning::IBNLearner::Database::_min_nb_rows_per_thread_ {100}
protected

the minimal number of rows to parse (on average) by thread

Definition at line 289 of file IBNLearner.h.

◆ _nodeId2cols_

Bijection< NodeId, std::size_t > gum::learning::IBNLearner::Database::_nodeId2cols_
protected

a bijection assigning to each variable name its NodeId

Definition at line 283 of file IBNLearner.h.

Referenced by Database(), Database(), Database(), Database(), Database(), idFromName(), nameFromId(), nodeId2Columns(), operator=(), and operator=().

◆ _parser_

DBRowGeneratorParser* gum::learning::IBNLearner::Database::_parser_ {nullptr}
protected

the parser used for reading the database

Definition at line 277 of file IBNLearner.h.

Referenced by Database(), Database(), Database(), Database(), Database(), ~Database(), operator=(), operator=(), and parser().


The documentation for this class was generated from the following files: