87#ifndef GUM_BN_DATABASE_GENERATOR_H
88#define GUM_BN_DATABASE_GENERATOR_H
102 template < GUM_Numeric GUM_SCALAR >
165 void toCSV(std::string_view csvFileURL,
166 bool useLabels =
true,
168 std::string csvSeparator =
",",
169 bool checkOnAppend =
false)
const;
176 std::vector< std::vector< Idx > >
database()
const;
191 void setVarOrderFromCSV(std::string_view csvFileURL, std::string_view csvSeparator =
",");
203 std::vector< Idx >
varOrder()
const;
212 const BayesNet< GUM_SCALAR >&
bn(
void);
219 const BayesNet< GUM_SCALAR >&
_bn_;
245 std::string_view csvSeparator =
",")
const;
249 std::string_view csvSeparator =
",")
const;
259#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Class representing Bayesian networks.
Base class for discrete random variable.
Class for assigning/browsing values to tuples of discrete variables.
Notification for progress using listener.
bool _drawnSamples_
whether drawSamples has been already called.
std::vector< Idx > varOrder() const
returns variable order indexes
DatabaseTable toDatabaseTable(bool useLabels=true) const
generates a DatabaseVectInRAM
std::vector< Idx > _varOrderFromCSV_(std::string_view csvFileURL, std::string_view csvSeparator=",") const
returns varOrder from a csv file
BNDatabaseGenerator(BNDatabaseGenerator &&)=delete
std::string _label_(const std::vector< Idx > &row, const DiscreteVariable &v, Idx i) const
return the final string for a label (taking into account the behavior for DiscretizedVariable) from a...
BNDatabaseGenerator & operator=(const BNDatabaseGenerator &)=delete
std::vector< std::vector< Idx > > database() const
generates database according to bn into a std::vector
void setDiscretizedLabelModeRandom()
set the behaviour of sampling for discretized variable to uniformly draw double value
BNDatabaseGenerator & operator=(BNDatabaseGenerator &&)=delete
double _log2likelihood_
log2Likelihood of generated samples
const BayesNet< GUM_SCALAR > & bn(void)
return const ref to the Bayes Net
BNDatabaseGenerator(const BayesNet< GUM_SCALAR > &bn)
default constructor
Size samplesNbCols() const
generate and stock database, returns log2likelihood using ProgressNotifier as notification
std::string samplesLabelAt(Idx row, Idx col) const
generate and stock database, returns log2likelihood using ProgressNotifier as notification
void setDiscretizedLabelModeInterval()
set the behaviour of sampling for discretized variable to select the label : "[min,...
Bijection< std::string, NodeId > _names2ids_
bijection nodes names
std::vector< std::vector< Idx > > _database_
generated database
DiscretizedLabelMode _discretizedLabelMode_
BNDatabaseGenerator(const BNDatabaseGenerator &)=delete
const BayesNet< GUM_SCALAR > & _bn_
Bayesian network.
void setAntiTopologicalVarOrder()
set columns in antiTopoligical order
Size samplesNbRows() const
generate and stock database, returns log2likelihood using ProgressNotifier as notification
double log2likelihood() const
returns log2Likelihood of generated samples
void setTopologicalVarOrder()
set columns in topoligical order
void setDiscretizedLabelModeMedian()
set the behaviour of sampling for discretized variable to deterministic select double median of inter...
double drawSamples(Size nbSamples)
generate and stock database, returns log2likelihood using ProgressNotifier as notification
std::vector< Idx > _varOrder_
variable order in generated database
void setVarOrderFromCSV(std::string_view csvFileURL, std::string_view csvSeparator=",")
change columns order according to a csv file
std::vector< std::string > varOrderNames() const
returns variable order.
Size _nbVars_
number of variables
void toCSV(std::string_view csvFileURL, bool useLabels=true, bool append=false, std::string csvSeparator=",", bool checkOnAppend=false) const
generates csv representing the generated database
void setVarOrder(const std::vector< Idx > &varOrder)
change columns order
Idx samplesAt(Idx row, Idx col) const
generate and stock database, returns log2likelihood using ProgressNotifier as notification
void setRandomVarOrder()
set columns in random order
~BNDatabaseGenerator()
destructor
The class representing a tabular database as used by learning tasks.
The class representing a tabular database stored in RAM.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities
priority queues (in which an element cannot appear more than once)