![]() |
aGrUM 3.0.0
a C++ library for (probabilistic) graphical models
|
A pack of learning algorithms that can easily be used. More...
#include <BNLearner.h>
Public Types | |
| enum class | ScoreType { AIC , BD , BDeu , BIC , fNML , K2 , LOG2LIKELIHOOD , MDL } |
| an enumeration enabling to select easily the score we wish to use More... | |
| enum class | ParamEstimatorType { ML } |
| an enumeration to select the type of parameter estimation we shall apply More... | |
| enum class | BNLearnerPriorType { NO_prior , SMOOTHING , DIRICHLET_FROM_DATABASE , DIRICHLET_FROM_BAYESNET , BDEU } |
| an enumeration to select the prior More... | |
| enum class | AlgoType { K2 , GREEDY_HILL_CLIMBING , LOCAL_SEARCH_WITH_TABU_LIST , MIIC , PC , FCI , EXTENDED_GREEDY_HILL_CLIMBING , GREEDY_THICK_THINNING } |
| an enumeration to select easily the learning algorithm to use More... | |
| enum class | ApproximationSchemeSTATE : char { Undefined , Continue , Epsilon , Rate , Limit , TimeLimit , Stopped } |
| The different state of an approximation scheme. More... | |
Public Member Functions | |
| BayesNet< GUM_SCALAR > | learnBN () |
| learn a Bayes Net from a file (must have read the db before) | |
| BayesNet< GUM_SCALAR > | learnParameters (const DAG &dag, bool takeIntoAccountScore=true) |
| learns a BN (its parameters) with the structure passed in argument | |
| BayesNet< GUM_SCALAR > | learnParameters (const BayesNet< GUM_SCALAR > &bn, bool takeIntoAccountScore=true) |
| learns a BN (its parameters) with the BN structure passed in argument, EM being initialized by this argument | |
| BayesNet< GUM_SCALAR > | learnParameters (bool take_into_account_score=true) |
| learns a BN (its parameters) when its structure is known | |
| std::string | toString () const |
| std::vector< std::tuple< std::string, std::string, std::string > > | state () const |
| void | copyState (const BNLearner< GUM_SCALAR > &learner) |
| copy the states of the BNLearner | |
| BNLearner< GUM_SCALAR > & | setInitialDAG (const DAG &dag) |
| BNLearner< GUM_SCALAR > & | useEM (const double epsilon, const double noise=default_EM_noise) |
| use The EM algorithm to learn parameters | |
| BNLearner< GUM_SCALAR > & | useEMWithRateCriterion (const double epsilon, const double noise=default_EM_noise) |
| use The EM algorithm to learn parameters with the rate stopping criterion | |
| BNLearner< GUM_SCALAR > & | useEMWithDiffCriterion (const double epsilon, const double noise=default_EM_noise) |
| use The EM algorithm to learn parameters with the diff stopping criterion | |
| BNLearner< GUM_SCALAR > & | forbidEM () |
| prevent using the EM algorithm for parameter learning | |
| BNLearner< GUM_SCALAR > & | EMsetEpsilon (const double eps) |
| sets the stopping criterion of EM as being the minimal difference between two consecutive log-likelihoods | |
| BNLearner< GUM_SCALAR > & | EMdisableEpsilon () |
| Disable the min log-likelihood diff stopping criterion. | |
| BNLearner< GUM_SCALAR > & | EMenableEpsilon () |
| Enable the log-likelihood min diff stopping criterion in EM. | |
| BNLearner< GUM_SCALAR > & | EMsetMinEpsilonRate (const double rate) |
| sets the stopping criterion of EM as being the minimal log-likelihood's evolution rate | |
| BNLearner< GUM_SCALAR > & | EMdisableMinEpsilonRate () |
| Disable the log-likelihood evolution rate stopping criterion. | |
| BNLearner< GUM_SCALAR > & | EMenableMinEpsilonRate () |
| Enable the log-likelihood evolution rate stopping criterion. | |
| BNLearner< GUM_SCALAR > & | EMsetMaxIter (const Size max) |
| add a max iteration stopping criterion | |
| BNLearner< GUM_SCALAR > & | EMdisableMaxIter () |
| Disable stopping criterion on max iterations. | |
| BNLearner< GUM_SCALAR > & | EMenableMaxIter () |
| Enable stopping criterion on max iterations. | |
| BNLearner< GUM_SCALAR > & | EMsetMaxTime (const double timeout) |
| add a stopping criterion on timeout | |
| BNLearner< GUM_SCALAR > & | EMdisableMaxTime () |
| Disable EM's timeout stopping criterion. | |
| BNLearner< GUM_SCALAR > & | EMenableMaxTime () |
| enable EM's timeout stopping criterion | |
| BNLearner< GUM_SCALAR > & | EMsetPeriodSize (const Size p) |
| how many samples between 2 stoppings isEnabled | |
| BNLearner< GUM_SCALAR > & | EMsetVerbosity (const bool v) |
| sets or unsets EM's verbosity | |
| BNLearner< GUM_SCALAR > & | useScoreAIC () |
| BNLearner< GUM_SCALAR > & | useScoreBD () |
| BNLearner< GUM_SCALAR > & | useScoreBDeu () |
| BNLearner< GUM_SCALAR > & | useScoreBIC () |
| BNLearner< GUM_SCALAR > & | useScoreK2 () |
| BNLearner< GUM_SCALAR > & | useScoreLog2Likelihood () |
| BNLearner< GUM_SCALAR > & | useNoPrior () |
| BNLearner< GUM_SCALAR > & | useBDeuPrior (double weight=1.0) |
| BNLearner< GUM_SCALAR > & | useSmoothingPrior (double weight=1) |
| BNLearner< GUM_SCALAR > & | useDirichletPrior (std::string_view filename, double weight=1) |
| BNLearner< GUM_SCALAR > & | useDirichletPrior (const gum::BayesNet< GUM_SCALAR > &bn, double weight=1) |
| BNLearner< GUM_SCALAR > & | useGreedyHillClimbing () |
| BNLearner< GUM_SCALAR > & | useExtendedGreedyHillClimbing () |
| BNLearner< GUM_SCALAR > & | useGreedyThickThinning () |
| BNLearner< GUM_SCALAR > & | setGreedyThickThinningReversals (bool allow) |
| bool | greedyThickThinningReversals () const |
| BNLearner< GUM_SCALAR > & | useLocalSearchWithTabuList (Size tabu_size=100, Size nb_decrease=2) |
| BNLearner< GUM_SCALAR > & | useK2 (const Sequence< NodeId > &order) |
| BNLearner< GUM_SCALAR > & | useK2 (const std::vector< NodeId > &order) |
| BNLearner< GUM_SCALAR > & | useMIIC () |
| BNLearner< GUM_SCALAR > & | usePC () |
| BNLearner< GUM_SCALAR > & | useFCI () |
| BNLearner< GUM_SCALAR > & | useFCIChi2Test () |
| BNLearner< GUM_SCALAR > & | useFCIG2Test () |
| BNLearner< GUM_SCALAR > & | setFCIAlpha (double alpha) |
| BNLearner< GUM_SCALAR > & | setFCIMaxPathLength (Size max_len) |
| BNLearner< GUM_SCALAR > & | setFCIExhaustiveSepSet (bool exhaustive) |
| bool | fciExhaustiveSepSet () const |
| BNLearner< GUM_SCALAR > & | useChi2Test () |
| BNLearner< GUM_SCALAR > & | useG2Test () |
| BNLearner< GUM_SCALAR > & | setPCAlpha (double alpha) |
| BNLearner< GUM_SCALAR > & | setPCStable (bool stable) |
| BNLearner< GUM_SCALAR > & | setPCMaxCondSetSize (Size max_k) |
| BNLearner< GUM_SCALAR > & | setPCUnshieldedColliderSorted (bool sorted) |
| BNLearner< GUM_SCALAR > & | useNMLCorrection () |
| BNLearner< GUM_SCALAR > & | useMDLCorrection () |
| BNLearner< GUM_SCALAR > & | useNoCorrection () |
| BNLearner< GUM_SCALAR > & | setMaxIndegree (Size max_indegree) |
| BNLearner< GUM_SCALAR > & | setSliceOrder (const NodeProperty< NodeId > &slice_order) |
| BNLearner< GUM_SCALAR > & | setSliceOrder (const std::vector< std::vector< std::string > > &slices) |
| BNLearner< GUM_SCALAR > & | setTotalOrder (const std::vector< std::string > &order) |
| BNLearner< GUM_SCALAR > & | setTotalOrder (const Sequence< NodeId > &order) |
| BNLearner< GUM_SCALAR > & | setForbiddenArcs (const ArcSet &set) |
| BNLearner< GUM_SCALAR > & | addForbiddenArc (const Arc &arc) |
| BNLearner< GUM_SCALAR > & | addForbiddenArc (NodeId tail, NodeId head) |
| BNLearner< GUM_SCALAR > & | addForbiddenArc (std::string_view tail, std::string_view head) |
| BNLearner< GUM_SCALAR > & | eraseForbiddenArc (const Arc &arc) |
| BNLearner< GUM_SCALAR > & | eraseForbiddenArc (NodeId tail, NodeId head) |
| BNLearner< GUM_SCALAR > & | eraseForbiddenArc (std::string_view tail, std::string_view head) |
| BNLearner< GUM_SCALAR > & | addMandatoryArc (const Arc &arc) |
| BNLearner< GUM_SCALAR > & | addMandatoryArc (NodeId tail, NodeId head) |
| BNLearner< GUM_SCALAR > & | addMandatoryArc (std::string_view tail, std::string_view head) |
| BNLearner< GUM_SCALAR > & | eraseMandatoryArc (const Arc &arc) |
| BNLearner< GUM_SCALAR > & | eraseMandatoryArc (NodeId tail, NodeId head) |
| BNLearner< GUM_SCALAR > & | eraseMandatoryArc (std::string_view tail, std::string_view head) |
| BNLearner< GUM_SCALAR > & | addPossibleEdge (const Edge &edge) |
| BNLearner< GUM_SCALAR > & | addPossibleEdge (NodeId tail, NodeId head) |
| BNLearner< GUM_SCALAR > & | addPossibleEdge (std::string_view tail, std::string_view head) |
| BNLearner< GUM_SCALAR > & | erasePossibleEdge (const Edge &edge) |
| BNLearner< GUM_SCALAR > & | erasePossibleEdge (NodeId tail, NodeId head) |
| BNLearner< GUM_SCALAR > & | erasePossibleEdge (std::string_view tail, std::string_view head) |
| BNLearner< GUM_SCALAR > & | setMandatoryArcs (const ArcSet &set) |
| BNLearner< GUM_SCALAR > & | setPossibleEdges (const EdgeSet &set) |
| BNLearner< GUM_SCALAR > & | setPossibleSkeleton (const UndiGraph &skeleton) |
| BNLearner< GUM_SCALAR > & | addNoParentNode (NodeId node) |
| BNLearner< GUM_SCALAR > & | addNoParentNode (std::string_view name) |
| BNLearner< GUM_SCALAR > & | eraseNoParentNode (NodeId node) |
| BNLearner< GUM_SCALAR > & | eraseNoParentNode (std::string_view name) |
| BNLearner< GUM_SCALAR > & | addNoChildrenNode (NodeId node) |
| BNLearner< GUM_SCALAR > & | addNoChildrenNode (std::string_view name) |
| BNLearner< GUM_SCALAR > & | eraseNoChildrenNode (NodeId node) |
| BNLearner< GUM_SCALAR > & | eraseNoChildrenNode (std::string_view name) |
| BNLearner< GUM_SCALAR > & | allowArcAdditions (bool allow) |
| BNLearner< GUM_SCALAR > & | allowArcDeletions (bool allow) |
| BNLearner< GUM_SCALAR > & | allowArcReversals (bool allow) |
| BNLearner< GUM_SCALAR > & | allowArcTriangleDeletions (bool allow) |
| bool | isConstraintBased () const |
| bool | isScoreBased () const |
| Size | EMPeriodSize () const |
| void | unsetTotalOrder () |
| removes the current total ordering constraint, if any | |
Constructors / Destructors | |
| BNLearner (std::string_view filename, const std::vector< std::string > &missingSymbols={"?"}, const bool induceTypes=true) | |
| default constructor | |
| BNLearner (const DatabaseTable &db) | |
| default constructor | |
| BNLearner (std::string_view filename, const gum::BayesNet< GUM_SCALAR > &src, const std::vector< std::string > &missing_symbols={"?"}) | |
| Wrapper for BNLearner (filename,modalities,parse_database) using a bn to find those modalities and nodeids. | |
| BNLearner (const BNLearner &) | |
| copy constructor | |
| BNLearner (BNLearner &&) | |
| move constructor | |
| ~BNLearner () override | |
| destructor | |
Operators | |
| BNLearner & | operator= (const BNLearner &) |
| copy operator | |
| BNLearner & | operator= (BNLearner &&) noexcept |
| move operator | |
Accessors / Modifiers | |
| DAG | learnDAG () |
| learn a structure from a file (must have read the db before) | |
| PDAG | learnPDAG () |
| learn a partial structure from a file (must have read the db before and must have selected miic) | |
| PAG | learnPAG () |
| learn a PAG — only valid when useFCI() has been called | |
| DAG | initialDAG () |
| returns the initial DAG structure | |
| const std::vector< std::string > & | names () const |
| returns the names of the variables in the database | |
| const std::vector< std::size_t > & | domainSizes () const |
| returns the domain sizes of the variables in the database | |
| Size | domainSize (NodeId var) const |
| learn a structure from a file (must have read the db before) | |
| Size | domainSize (std::string_view var) const |
| learn a structure from a file (must have read the db before) | |
| NodeId | idFromName (std::string_view var_name) const |
| returns the node id corresponding to a variable name | |
| const DatabaseTable & | database () const |
| returns the database used by the BNLearner | |
| void | setDatabaseWeight (const double new_weight) |
| assign a weight to all the rows of the learning database so that the sum of their weights is equal to new_weight | |
| void | setRecordWeight (const std::size_t i, const double weight) |
| sets the weight of the ith record of the database | |
| double | recordWeight (const std::size_t i) const |
| returns the weight of the ith record | |
| double | databaseWeight () const |
| returns the weight of the whole database | |
| const std::string & | nameFromId (NodeId id) const |
| returns the variable name corresponding to a given node id | |
| void | useDatabaseRanges (const std::vector< std::pair< std::size_t, std::size_t > > &new_ranges) |
| use a new set of database rows' ranges to perform learning | |
| void | clearDatabaseRanges () |
| reset the ranges to the one range corresponding to the whole database | |
| const std::vector< std::pair< std::size_t, std::size_t > > & | databaseRanges () const |
| returns the current database rows' ranges used for learning | |
| std::pair< std::size_t, std::size_t > | useCrossValidationFold (const std::size_t learning_fold, const std::size_t k_fold) |
| sets the ranges of rows to be used for cross-validation learning | |
| std::pair< double, double > | chi2 (NodeId id1, NodeId id2, const std::vector< NodeId > &knowing={}) |
| Return the <statistic,pvalue> pair for chi2 test in the database. | |
| std::pair< double, double > | chi2 (std::string_view name1, std::string_view name2, const std::vector< std::string > &knowing={}) |
| Return the <statistic,pvalue> pair for the BNLearner. | |
| std::pair< double, double > | G2 (NodeId id1, NodeId id2, const std::vector< NodeId > &knowing={}) |
| Return the <statistic,pvalue> pair for for G2 test in the database. | |
| std::pair< double, double > | G2 (std::string_view name1, std::string_view name2, const std::vector< std::string > &knowing={}) |
| Return the <statistic,pvalue> pair for for G2 test in the database. | |
| double | logLikelihood (const std::vector< NodeId > &vars, const std::vector< NodeId > &knowing={}) |
| Return the loglikelihood of vars in the base, conditioned by knowing for the BNLearner. | |
| double | logLikelihood (const std::vector< std::string > &vars, const std::vector< std::string > &knowing={}) |
| Return the loglikelihood of vars in the base, conditioned by knowing for the BNLearner. | |
| double | mutualInformation (NodeId id1, NodeId id2, const std::vector< NodeId > &knowing={}) |
| Return the mutual information of id1 and id2 in the base, conditioned by knowing for the BNLearner. | |
| double | mutualInformation (std::string_view var1, std::string_view var2, const std::vector< std::string > &knowing={}) |
| Return the mutual information of var1 and var2 in the base, conditioned by knowing for the BNLearner. | |
| double | correctedMutualInformation (NodeId id1, NodeId id2, const std::vector< NodeId > &knowing={}) |
| Return the mutual information of id1 and id2 in the base, conditioned by knowing for the BNLearner. | |
| double | correctedMutualInformation (std::string_view var1, std::string_view var2, const std::vector< std::string > &knowing={}) |
| Return the mutual information of var1 and var2 in the base, conditioned by knowing for the BNLearner. | |
| double | score (NodeId vars, const std::vector< NodeId > &knowing={}) |
| Return the value of the score currently in use by the BNLearner of a variable given a set of other variables. | |
| double | score (std::string_view vars, const std::vector< std::string > &knowing={}) |
| Return the value of the score currently in use by the BNLearner of a variable given a set of other variables The score used is the one currently selected in the BNLearner. | |
| std::vector< double > | rawPseudoCount (const std::vector< NodeId > &vars) |
| Return the pseudo-counts of NodeIds vars in the base in a raw array. | |
| std::vector< double > | rawPseudoCount (const std::vector< std::string > &vars) |
| Return the pseudoconts of vars in the base in a raw array. | |
| Size | nbCols () const |
| Size | nbRows () const |
| bool | isUsingEM () const |
| indicates whether we use EM for parameter learning | |
| EMApproximationScheme & | EM () |
| returns the EM parameter learning approximation scheme if EM is enabled | |
| ApproximationSchemeSTATE | EMState () const |
| returns the state of the last EM algorithm executed | |
| std::string | EMStateMessage () const |
| returns the state of the EM algorithm | |
| bool | hasMissingValues () const |
| returns true if the learner's database has missing values | |
Score selection | |
| void | useScorefNML () |
| indicate that we wish to use a fNML score | |
| void | useScoreMDL () |
| indicate that we wish to use a MDL score | |
a prior selection / parameterization | |
| std::string | checkScorePriorCompatibility () const |
| checks whether the current score and prior are compatible | |
MIIC parameterization and specific results | |
| std::vector< Arc > | latentVariables () const |
| get the list of arcs hiding latent variables | |
Accessors / Modifiers for adding constraints on learning | |
| void | unsetSliceOrder () |
| removes the slice order constraint | |
Multithreading | |
| void | setNumberOfThreads (Size nb) override |
| sets the number max of threads that can be used | |
redistribute signals AND implementation of interface | |
| void | setCurrentApproximationScheme (const ApproximationScheme *approximationScheme) |
| {@ /// distribute signals | |
| void | distributeProgress (const ApproximationScheme *approximationScheme, Size pourcent, double error, double time) |
| {@ /// distribute signals | |
| void | distributeStop (const ApproximationScheme *approximationScheme, std::string_view message) |
| distribute signals | |
| void | setEpsilon (double eps) override |
| Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)| If the criterion was disabled it will be enabled. | |
| double | epsilon () const override |
| Get the value of epsilon. | |
| void | disableEpsilon () override |
| Disable stopping criterion on epsilon. | |
| void | enableEpsilon () override |
| Enable stopping criterion on epsilon. | |
| bool | isEnabledEpsilon () const override |
| void | setMinEpsilonRate (double rate) override |
| Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|) If the criterion was disabled it will be enabled. | |
| double | minEpsilonRate () const override |
| Get the value of the minimal epsilon rate. | |
| void | disableMinEpsilonRate () override |
| Disable stopping criterion on epsilon rate. | |
| void | enableMinEpsilonRate () override |
| Enable stopping criterion on epsilon rate. | |
| bool | isEnabledMinEpsilonRate () const override |
| void | setMaxIter (Size max) override |
| stopping criterion on number of iterationsIf the criterion was disabled it will be enabled | |
| Size | maxIter () const override |
| void | disableMaxIter () override |
| Disable stopping criterion on max iterations. | |
| void | enableMaxIter () override |
| Enable stopping criterion on max iterations. | |
| bool | isEnabledMaxIter () const override |
| void | setMaxTime (double timeout) override |
| stopping criterion on timeout If the criterion was disabled it will be enabled | |
| double | maxTime () const override |
| returns the timeout (in seconds) | |
| double | currentTime () const override |
| get the current running time in second (double) | |
| void | disableMaxTime () override |
| Disable stopping criterion on timeout. | |
| void | enableMaxTime () override |
| stopping criterion on timeout If the criterion was disabled it will be enabled | |
| bool | isEnabledMaxTime () const override |
| void | setPeriodSize (Size p) override |
| how many samples between 2 stopping isEnableds | |
| Size | periodSize () const override |
| how many samples between 2 stopping isEnableds | |
| void | setVerbosity (bool v) override |
| verbosity | |
| bool | verbosity () const override |
| verbosity | |
| ApproximationSchemeSTATE | stateApproximationScheme () const override |
| history | |
| Size | nbrIterations () const override |
| const std::vector< double > & | history () const override |
EM approximation scheme for parameter learning | |
| double | EMEpsilon () const |
| Get the value of EM's min diff epsilon. | |
| bool | EMisEnabledEpsilon () const |
| return true if EM's stopping criterion is the log-likelihood min diff | |
| double | EMMinEpsilonRate () const |
| Get the value of the minimal log-likelihood evolution rate of EM. | |
| bool | EMisEnabledMinEpsilonRate () const |
| Size | EMMaxIter () const |
| return the max number of iterations criterion | |
| bool | EMisEnabledMaxIter () const |
| double | EMMaxTime () const |
| @brief returns EM's timeout (in milliseconds) | |
| double | EMCurrentTime () const |
| get the current running time in second (double) | |
| bool | EMisEnabledMaxTime () const |
| bool | EMVerbosity () const |
| returns the EM's verbosity status | |
| ApproximationSchemeSTATE | EMStateApproximationScheme () const |
| get the current state of EM | |
| Size | EMnbrIterations () const |
| returns the number of iterations performed by the last EM execution | |
| const std::vector< double > & | EMHistory () const |
| returns the history of the last EM execution | |
Getters and setters | |
| std::string | messageApproximationScheme () const |
| Returns the approximation scheme message. | |
Accessors/Modifiers | |
| Size | getNumberOfThreads () const override |
| returns the current max number of threads used by the class containing this ThreadNumberManager | |
| bool | isGumNumberOfThreadsOverriden () const override |
| indicates whether the class containing this ThreadNumberManager set its own number of threads | |
Public Attributes | |
| Signaler< Size, double, double > | onProgress |
| Progression, error and time. | |
| Signaler< std::string_view > | onStop |
| Criteria messageApproximationScheme. | |
Static Public Attributes | |
| static constexpr double | default_EM_noise {0.1} |
| the default noise amount added to CPTs during EM's initialization (see method useEM()) | |
Protected Types | |
| enum class | IndepTestType { Chi2 , G2 } |
| independence test type for PC More... | |
Protected Member Functions | |
| void | createPrior_ () override |
| create the prior used for learning | |
| PAG | learnPAG_ () |
| PDAG | learnPDAG_ () |
| void | _setPriorWeight_ (double weight) |
| sets the prior weight | |
| void | createScore_ () |
| create the score used for learning | |
| ParamEstimator * | createParamEstimator_ (const DBRowGeneratorParser &parser, bool take_into_account_score=true) |
| create the parameter estimator used for learning | |
| DAG | learnDag_ () |
| returns the DAG learnt | |
| MixedGraph | prepareSimpleMiic_ () |
| prepares the initial graph for Simple Miic | |
| MixedGraph | prepareMiic_ () |
| prepares the initial graph for miic | |
| MixedGraph | preparePC_ () |
| prepares the initial graph and independence test for PC | |
| MixedGraph | prepareFCI_ () |
| prepares the initial graph and independence test for FCI | |
| PriorType | getPriorType_ () const |
| returns the type (as a string) of a given prior | |
| void | createCorrectedMutualInformation_ () |
| create the Corrected Mutual Information instance for Miic | |
Static Protected Member Functions | |
| static DatabaseTable | readFile_ (std::string_view filename, const std::vector< std::string > &missing_symbols) |
| reads a file and returns a databaseVectInRam | |
| static void | isCSVFileName_ (std::string_view filename) |
| checks whether the extension of a CSV filename is correct | |
Protected Attributes | |
| bool | inducedTypes_ {false} |
| the policy for typing variables | |
| ScoreType | scoreType_ {ScoreType::BDeu} |
| the score selected for learning | |
| Score * | score_ {nullptr} |
| the score used | |
| ParamEstimatorType | paramEstimatorType_ {ParamEstimatorType::ML} |
| the type of the parameter estimator | |
| bool | useEM_ {false} |
| a Boolean indicating whether we should use EM for parameter learning or not | |
| double | noiseEM_ {0.1} |
| the noise factor (in (0,1)) used by EM for perturbing the CPT during init | |
| CorrectedMutualInformation * | mutualInfo_ {nullptr} |
| the selected correction for miic | |
| BNLearnerPriorType | priorType_ {BNLearnerPriorType::NO_prior} |
| the a priorselected for the score and parameters | |
| Prior * | prior_ {nullptr} |
| the prior used | |
| NoPrior * | noPrior_ {nullptr} |
| double | priorWeight_ {1.0f} |
| the weight of the prior | |
| StructuralConstraintSliceOrder | constraintSliceOrder_ |
| the constraint for 2TBNs | |
| StructuralConstraintTotalOrder | constraintTotalOrder_ |
| the total order ing constraint | |
| StructuralConstraintIndegree | constraintIndegree_ |
| the constraint for indegrees | |
| StructuralConstraintTabuList | constraintTabuList_ |
| the constraint for tabu lists | |
| StructuralConstraintForbiddenArcs | constraintForbiddenArcs_ |
| the constraint on forbidden arcs | |
| StructuralConstraintPossibleEdges | constraintPossibleEdges_ |
| the constraint on possible Edges | |
| StructuralConstraintMandatoryArcs | constraintMandatoryArcs_ |
| the constraint on mandatory arcs | |
| StructuralConstraintNoParentNodes | constraintNoParentNodes_ |
| the constraint on no parent nodes | |
| StructuralConstraintNoChildrenNodes | constraintNoChildrenNodes_ |
| the constraint on no children nodes | |
| AlgoType | selectedAlgo_ {AlgoType::MIIC} |
| the selected learning algorithm | |
| bool | allowArcAdditions_ {true} |
| whether we allow or not arc additions during learning | |
| bool | allowArcDeletions_ {true} |
| whether we allow or not arc deletions during learning | |
| bool | allowArcReversals_ {true} |
| whether we allow or not arc reversals during learning | |
| bool | allowArcTriangleDeletions_ {true} |
| whether we allow or not arc deletions during learning | |
| K2 | algoK2_ |
| the K2 algorithm | |
| SimpleMiic | algoSimpleMiic_ |
| the MIIC algorithm | |
| Miic | algoMiic_ |
| the Constraint MIIC algorithm | |
| CorrectedMutualInformation::KModeTypes | kmodeMiic_ |
| the penalty used in MIIC | |
| gum::learning::PC | algoPC_ |
| the PC algorithm | |
| IndepTestType | indepTestTypePC_ {IndepTestType::Chi2} |
| IndependenceTest * | indepTestPC_ {nullptr} |
| owned independence test object for PC (rebuilt before each learn call) | |
| double | alphaPc_ {0.05} |
| PC parameters. | |
| bool | stablePc_ {true} |
| Size | maxCondSetSizePc_ {Size(-1)} |
| bool | sortedUCPc_ {false} |
| gum::learning::FCI | algoFCI_ |
| the FCI algorithm | |
| IndepTestType | indepTestTypeFCI_ {IndepTestType::Chi2} |
| independence test type for FCI (reuses IndepTestType defined above) | |
| IndependenceTest * | indepTestFCI_ {nullptr} |
| owned independence test object for FCI (rebuilt before each learn call) | |
| double | alphaFci_ {0.05} |
| FCI parameters. | |
| Size | maxPathLengthFci_ {Size(-1)} |
| bool | exhaustiveSepSetFci_ {false} |
| DAG2BNLearner | dag2BN_ |
| the parametric EM | |
| GreedyHillClimbing | greedyHillClimbing_ |
| the greedy hill climbing algorithm | |
| GreedyHillClimbing | extendedGreedyHillClimbing_ |
| the extended greedy hill climbing | |
| GreedyThickThinning | greedyThickThinning_ |
| the greedy thick-thinning algorithm | |
| LocalSearchWithTabuList | localSearchWithTabuList_ |
| the local search with tabu list algorithm | |
| Database | scoreDatabase_ |
| the database to be used by the scores and parameter estimators | |
| std::vector< std::pair< std::size_t, std::size_t > > | ranges_ |
| the set of rows' ranges within the database in which learning is done | |
| Database * | priorDatabase_ {nullptr} |
| the database used by the Dirichlet a priori | |
| std::string | priorDbname_ |
| the filename for the Dirichlet a priori, if any | |
| DAG | initialDag_ |
| an initial DAG given to learners | |
| std::string | filename_ {"-"} |
| the filename database | |
| Size | nbDecreasingChanges_ {2} |
| const ApproximationScheme * | currentAlgorithm_ {nullptr} |
Private Member Functions | |
| NodeProperty< Sequence< std::string > > | _labelsFromBN_ (std::string_view filename, const BayesNet< GUM_SCALAR > &src) |
| read the first line of a file to find column names | |
| void | _checkDAGCompatibility_ (const DAG &dag) |
| check that the database contains the nodes of the dag, else raise an exception | |
| BayesNet< GUM_SCALAR > | _learnParameters_ (const DAG &dag, bool takeIntoAccountScore) |
| learns a BN (its parameters) with the structure passed in argument using a single pass estimation (not EM) | |
| std::pair< std::shared_ptr< ParamEstimator >, std::shared_ptr< ParamEstimator > > | _initializeEMParameterLearning_ (const DAG &dag, bool takeIntoAccountScore) |
| initializes EM and returns a pair containing, first, a bootstrap estimator and, second, the EM estimator | |
| BayesNet< GUM_SCALAR > | _learnParametersWithEM_ (const DAG &dag, bool takeIntoAccountScore) |
| learns a BN (its parameters) with the structure passed in argument using the EM algorithm initialized by the BNLearner | |
| BayesNet< GUM_SCALAR > | _learnParametersWithEM_ (const BayesNet< GUM_SCALAR > &bn, bool takeIntoAccountScore) |
| learns a BN (its parameters) with the structure passed in argument using the EM algorithm initialized by the Bayes net passed in argument | |
Private Attributes | |
| BayesNet< GUM_SCALAR > | _prior_bn_ |
| Size | _nb_threads_ {0} |
| the max number of threads used by the class | |
A pack of learning algorithms that can easily be used.
The pack currently contains K2, GreedyHillClimbing and LocalSearchWithTabuList
Definition at line 74 of file BNLearner.h.
|
stronginherited |
an enumeration to select easily the learning algorithm to use
| Enumerator | |
|---|---|
| K2 | |
| GREEDY_HILL_CLIMBING | |
| LOCAL_SEARCH_WITH_TABU_LIST | |
| MIIC | |
| PC | |
| FCI | |
| EXTENDED_GREEDY_HILL_CLIMBING | |
| GREEDY_THICK_THINNING | |
Definition at line 123 of file IBNLearner.h.
|
stronginherited |
The different state of an approximation scheme.
| Enumerator | |
|---|---|
| Undefined | |
| Continue | |
| Epsilon | |
| Rate | |
| Limit | |
| TimeLimit | |
| Stopped | |
Definition at line 87 of file IApproximationSchemeConfiguration.h.
|
stronginherited |
an enumeration to select the prior
| Enumerator | |
|---|---|
| NO_prior | |
| SMOOTHING | |
| DIRICHLET_FROM_DATABASE | |
| DIRICHLET_FROM_BAYESNET | |
| BDEU | |
Definition at line 114 of file IBNLearner.h.
|
strongprotectedinherited |
independence test type for PC
| Enumerator | |
|---|---|
| Chi2 | |
| G2 | |
Definition at line 1209 of file IBNLearner.h.
|
stronginherited |
an enumeration to select the type of parameter estimation we shall apply
| Enumerator | |
|---|---|
| ML | |
Definition at line 111 of file IBNLearner.h.
|
stronginherited |
an enumeration enabling to select easily the score we wish to use
| Enumerator | |
|---|---|
| AIC | |
| BD | |
| BDeu | |
| BIC | |
| fNML | |
| K2 | |
| LOG2LIKELIHOOD | |
| MDL | |
Definition at line 107 of file IBNLearner.h.
| gum::learning::BNLearner< GUM_SCALAR >::BNLearner | ( | std::string_view | filename, |
| const std::vector< std::string > & | missingSymbols = {"?"}, | ||
| const bool | induceTypes = true ) |
default constructor
read the database file for the score / parameter estimation and var names
| filename | the name of a CSV file containing the dataset |
| missingSymbols | the set of symbols in the CSV that should be interpreted as missing values |
| induceTypes | By 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 to tag them as corresponding to integer, range or continuous variables. By setting induceTypes to true, this is precisely what the BNLearner will do. |
Referenced by BNLearner(), BNLearner(), addForbiddenArc(), addForbiddenArc(), addForbiddenArc(), addMandatoryArc(), addMandatoryArc(), addMandatoryArc(), addNoChildrenNode(), addNoChildrenNode(), addNoParentNode(), addNoParentNode(), addPossibleEdge(), addPossibleEdge(), addPossibleEdge(), allowArcAdditions(), allowArcDeletions(), allowArcReversals(), allowArcTriangleDeletions(), copyState(), EMdisableEpsilon(), EMdisableMaxIter(), EMdisableMaxTime(), EMdisableMinEpsilonRate(), EMenableEpsilon(), EMenableMaxIter(), EMenableMaxTime(), EMenableMinEpsilonRate(), EMsetEpsilon(), EMsetMaxIter(), EMsetMaxTime(), EMsetMinEpsilonRate(), EMsetPeriodSize(), EMsetVerbosity(), eraseForbiddenArc(), eraseForbiddenArc(), eraseForbiddenArc(), eraseMandatoryArc(), eraseMandatoryArc(), eraseMandatoryArc(), eraseNoChildrenNode(), eraseNoChildrenNode(), eraseNoParentNode(), eraseNoParentNode(), erasePossibleEdge(), erasePossibleEdge(), erasePossibleEdge(), forbidEM(), operator=(), operator=(), setFCIAlpha(), setFCIExhaustiveSepSet(), setFCIMaxPathLength(), setForbiddenArcs(), setGreedyThickThinningReversals(), setInitialDAG(), setMandatoryArcs(), setMaxIndegree(), setPCAlpha(), setPCMaxCondSetSize(), setPCStable(), setPCUnshieldedColliderSorted(), setPossibleEdges(), setPossibleSkeleton(), setSliceOrder(), setTotalOrder(), setTotalOrder(), useBDeuPrior(), useChi2Test(), useDirichletPrior(), useDirichletPrior(), useEM(), useEMWithDiffCriterion(), useEMWithRateCriterion(), useExtendedGreedyHillClimbing(), useFCI(), useFCIChi2Test(), useFCIG2Test(), useG2Test(), useGreedyHillClimbing(), useGreedyThickThinning(), useK2(), useK2(), useLocalSearchWithTabuList(), useMDLCorrection(), useMIIC(), useNMLCorrection(), useNoCorrection(), useNoPrior(), usePC(), useScoreAIC(), useScoreBD(), useScoreBDeu(), useScoreBIC(), useScoreK2(), useScoreLog2Likelihood(), and useSmoothingPrior().
| gum::learning::BNLearner< GUM_SCALAR >::BNLearner | ( | const DatabaseTable & | db | ) |
default constructor
read the database file for the score / parameter estimation and var names
| db | an already initialized database table that is used to fill the Database |
| gum::learning::BNLearner< GUM_SCALAR >::BNLearner | ( | std::string_view | filename, |
| const gum::BayesNet< GUM_SCALAR > & | src, | ||
| const std::vector< std::string > & | missing_symbols = {"?"} ) |
Wrapper for BNLearner (filename,modalities,parse_database) using a bn to find those modalities and nodeids.
| gum::learning::BNLearner< GUM_SCALAR >::BNLearner | ( | const BNLearner< GUM_SCALAR > & | ) |
| gum::learning::BNLearner< GUM_SCALAR >::BNLearner | ( | BNLearner< GUM_SCALAR > && | ) |
|
override |
destructor
|
private |
check that the database contains the nodes of the dag, else raise an exception
| MissingVariableInDatabase | if a variable of the BN is not found in the database. |
References _checkDAGCompatibility_().
Referenced by _checkDAGCompatibility_().
|
private |
initializes EM and returns a pair containing, first, a bootstrap estimator and, second, the EM estimator
| dag | the graphical structure of the BN learnt by EM |
| takeIntoAccountScore | The dag passed in argument may have been learnt from a structure learning. In this case, if the score used to learn the structure has an implicit prior (like K2 which has a 1-smoothing prior), it is important to also take into account this implicit prior for parameter learning. By default, if a score exists, we will learn parameters by taking into account the prior specified by methods usePriorXXX () + the implicit prior of the score, else we just take into account the prior specified by usePriorXXX () |
References _initializeEMParameterLearning_().
Referenced by _initializeEMParameterLearning_().
|
private |
read the first line of a file to find column names
References _labelsFromBN_().
Referenced by _labelsFromBN_().
|
private |
learns a BN (its parameters) with the structure passed in argument using a single pass estimation (not EM)
| dag | the structure of the Bayesian network |
| takeIntoAccountScore | The dag passed in argument may have been learnt from a structure learning. In this case, if the score used to learn the structure has an implicit prior (like K2 which has a 1-smoothing prior), it is important to also take into account this implicit prior for parameter learning. By default, if a score exists, we will learn parameters by taking into account the prior specified by methods usePriorXXX () + the implicit prior of the score, else we just take into account the prior specified by usePriorXXX () |
| MissingVariableInDatabase | if a variable of the BN is not found in the database. |
| MissingValueInDatabase | if the database contains some missing values |
References _learnParameters_().
Referenced by _learnParameters_().
|
private |
learns a BN (its parameters) with the structure passed in argument using the EM algorithm initialized by the Bayes net passed in argument
| bn | the Bayesian network used to specify the graphical structure of the returned Bayes net and to initialize its CPTs before running EM. When a CPT is filled exclusively with only zeroes, then this one is initialized by the BNLearner using a specific estimator that does not take into account the missing values in the database |
| takeIntoAccountScore | The dag passed in argument may have been learnt from a structure learning. In this case, if the score used to learn the structure has an implicit prior (like K2 which has a 1-smoothing prior), it is important to also take into account this implicit prior for parameter learning. By default, if a score exists, we will learn parameters by taking into account the prior specified by methods usePriorXXX () + the implicit prior of the score, else we just take into account the prior specified by usePriorXXX () |
| MissingVariableInDatabase | if a variable of the BN is not found in the database. |
References _learnParametersWithEM_().
|
private |
learns a BN (its parameters) with the structure passed in argument using the EM algorithm initialized by the BNLearner
| dag | the structure of the Bayesian network |
| takeIntoAccountScore | The dag passed in argument may have been learnt from a structure learning. In this case, if the score used to learn the structure has an implicit prior (like K2 which has a 1-smoothing prior), it is important to also take into account this implicit prior for parameter learning. By default, if a score exists, we will learn parameters by taking into account the prior specified by methods usePriorXXX () + the implicit prior of the score, else we just take into account the prior specified by usePriorXXX () |
| MissingVariableInDatabase | if a variable of the BN is not found in the database. |
References _learnParametersWithEM_().
Referenced by _learnParametersWithEM_(), and _learnParametersWithEM_().
|
protectedinherited |
sets the prior weight
Definition at line 644 of file IBNLearner_inl.h.
References checkScorePriorCompatibility(), GUM_ERROR, and priorWeight_.
Referenced by useBDeuPrior(), useDirichletPrior(), and useSmoothingPrior().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addForbiddenArc | ( | const Arc & | arc | ) |
References BNLearner(), and addForbiddenArc().
Referenced by addForbiddenArc(), addForbiddenArc(), and addForbiddenArc().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addForbiddenArc | ( | NodeId | tail, |
| NodeId | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addForbiddenArc | ( | std::string_view | tail, |
| std::string_view | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addMandatoryArc | ( | const Arc & | arc | ) |
References BNLearner(), and addMandatoryArc().
Referenced by addMandatoryArc(), addMandatoryArc(), and addMandatoryArc().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addMandatoryArc | ( | NodeId | tail, |
| NodeId | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addMandatoryArc | ( | std::string_view | tail, |
| std::string_view | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addNoChildrenNode | ( | NodeId | node | ) |
References BNLearner(), and addNoChildrenNode().
Referenced by addNoChildrenNode(), and addNoChildrenNode().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addNoChildrenNode | ( | std::string_view | name | ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addNoParentNode | ( | NodeId | node | ) |
References BNLearner(), and addNoParentNode().
Referenced by addNoParentNode(), and addNoParentNode().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addNoParentNode | ( | std::string_view | name | ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addPossibleEdge | ( | const Edge & | edge | ) |
References BNLearner(), and addPossibleEdge().
Referenced by addPossibleEdge(), addPossibleEdge(), and addPossibleEdge().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addPossibleEdge | ( | NodeId | tail, |
| NodeId | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::addPossibleEdge | ( | std::string_view | tail, |
| std::string_view | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::allowArcAdditions | ( | bool | allow | ) |
References BNLearner(), and allowArcAdditions().
Referenced by allowArcAdditions().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::allowArcDeletions | ( | bool | allow | ) |
References BNLearner(), and allowArcDeletions().
Referenced by allowArcDeletions().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::allowArcReversals | ( | bool | allow | ) |
References BNLearner(), and allowArcReversals().
Referenced by allowArcReversals().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::allowArcTriangleDeletions | ( | bool | allow | ) |
References BNLearner(), and allowArcTriangleDeletions().
Referenced by allowArcTriangleDeletions().
|
inherited |
checks whether the current score and prior are compatible
Definition at line 1270 of file IBNLearner.cpp.
References AIC, BD, BDeu, BIC, fNML, getPriorType_(), isConstraintBased(), gum::learning::ScoreAIC::isPriorCompatible(), gum::learning::ScoreBD::isPriorCompatible(), gum::learning::ScoreBDeu::isPriorCompatible(), gum::learning::ScoreBIC::isPriorCompatible(), gum::learning::ScorefNML::isPriorCompatible(), gum::learning::ScoreK2::isPriorCompatible(), gum::learning::ScoreLog2Likelihood::isPriorCompatible(), LOG2LIKELIHOOD, MDL, priorWeight_, and scoreType_.
Referenced by _setPriorWeight_(), useBDeuPrior(), useDirichletPrior(), useNoPrior(), useScoreAIC(), useScoreBD(), useScoreBDeu(), useScoreBIC(), useScorefNML(), useScoreK2(), useScoreLog2Likelihood(), useScoreMDL(), and useSmoothingPrior().
|
inherited |
Return the <statistic,pvalue> pair for chi2 test in the database.
| id1 | first variable |
| id2 | second variable |
| knowing | list of observed variables |
Definition at line 1338 of file IBNLearner.cpp.
References createPrior_(), databaseRanges(), prior_, scoreDatabase_, and gum::learning::IndepTestChi2::statistics().
Referenced by chi2().
|
inherited |
Return the <statistic,pvalue> pair for the BNLearner.
| id1 | first variable |
| id2 | second variable |
| knowing | list of observed variables |
Definition at line 1345 of file IBNLearner.cpp.
References chi2(), and idFromName().
|
inherited |
reset the ranges to the one range corresponding to the whole database
Definition at line 729 of file IBNLearner_inl.h.
References ranges_.
| void gum::learning::BNLearner< GUM_SCALAR >::copyState | ( | const BNLearner< GUM_SCALAR > & | learner | ) |
copy the states of the BNLearner
References BNLearner(), and copyState().
Referenced by copyState().
|
inherited |
Return the mutual information of id1 and id2 in the base, conditioned by knowing for the BNLearner.
| id1 | nodeId |
| id2 | nodeId |
| knowing | an optional vector of conditioning NodeIds |
Definition at line 1403 of file IBNLearner.cpp.
References createPrior_(), databaseRanges(), GUM_ERROR, kmodeMiic_, MDL, prior_, gum::learning::CorrectedMutualInformation::score(), scoreDatabase_, gum::learning::CorrectedMutualInformation::useMDL(), gum::learning::CorrectedMutualInformation::useNML(), and gum::learning::CorrectedMutualInformation::useNoCorr().
Referenced by correctedMutualInformation().
|
inherited |
Return the mutual information of var1 and var2 in the base, conditioned by knowing for the BNLearner.
| var1 | name of a row |
| var2 | name of a row |
| knowing | an optional vector of conditioning rows |
Definition at line 1428 of file IBNLearner.cpp.
References correctedMutualInformation(), and idFromName().
|
protectedinherited |
create the Corrected Mutual Information instance for Miic
Definition at line 966 of file IBNLearner.cpp.
References GUM_ERROR, kmodeMiic_, MDL, mutualInfo_, noPrior_, ranges_, and scoreDatabase_.
Referenced by prepareMiic_().
|
protectedinherited |
create the parameter estimator used for learning
Definition at line 544 of file IBNLearner.cpp.
References gum::ThreadNumberManager::getNumberOfThreads(), GUM_ERROR, gum::ThreadNumberManager::isGumNumberOfThreadsOverriden(), ML, noPrior_, paramEstimatorType_, prior_, ranges_, score_, scoreDatabase_, gum::learning::ParamEstimator::setNumberOfThreads(), and gum::learning::ParamEstimator::setRanges().
|
overrideprotectedvirtual |
create the prior used for learning
Implements gum::learning::IBNLearner.
References createPrior_().
Referenced by createPrior_().
|
protectedinherited |
create the score used for learning
Definition at line 471 of file IBNLearner.cpp.
References AIC, BD, BDeu, BIC, fNML, gum::ThreadNumberManager::getNumberOfThreads(), GUM_ERROR, gum::ThreadNumberManager::isGumNumberOfThreadsOverriden(), K2, LOG2LIKELIHOOD, MDL, prior_, ranges_, score_, scoreDatabase_, and scoreType_.
Referenced by learnDAG(), and score().
|
overridevirtualinherited |
get the current running time in second (double)
Implements gum::IApproximationSchemeConfiguration.
Definition at line 890 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
inherited |
returns the database used by the BNLearner
Definition at line 732 of file IBNLearner_inl.h.
References scoreDatabase_.
Referenced by readFile_().
|
inherited |
returns the current database rows' ranges used for learning
Definition at line 724 of file IBNLearner_inl.h.
References ranges_.
Referenced by chi2(), correctedMutualInformation(), G2(), logLikelihood(), mutualInformation(), and rawPseudoCount().
|
inherited |
returns the weight of the whole database
Definition at line 161 of file IBNLearner_inl.h.
References scoreDatabase_.
|
overridevirtualinherited |
Disable stopping criterion on epsilon.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 797 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
Disable stopping criterion on max iterations.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 859 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
Disable stopping criterion on timeout.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 895 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
Disable stopping criterion on epsilon rate.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 828 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
inherited |
{@ /// distribute signals
Definition at line 771 of file IBNLearner_inl.h.
References GUM_EMIT3, gum::IApproximationSchemeConfiguration::onProgress, and setCurrentApproximationScheme().
|
inherited |
distribute signals
Definition at line 779 of file IBNLearner_inl.h.
References GUM_EMIT1, gum::IApproximationSchemeConfiguration::onStop, and setCurrentApproximationScheme().
learn a structure from a file (must have read the db before)
Definition at line 715 of file IBNLearner_inl.h.
References scoreDatabase_.
|
inherited |
learn a structure from a file (must have read the db before)
Definition at line 718 of file IBNLearner_inl.h.
References idFromName(), and scoreDatabase_.
|
inherited |
returns the domain sizes of the variables in the database
Definition at line 710 of file IBNLearner_inl.h.
References scoreDatabase_.
|
inherited |
returns the EM parameter learning approximation scheme if EM is enabled
returns the EM parameter learning approximation scheme
| NotFound | is raised if EM() is called while the EM algorithm has not been enabled by useEM(), useEMWithDiffCriterion() or useEMWithRateCriterion(). |
Definition at line 436 of file IBNLearner_inl.h.
|
inherited |
get the current running time in second (double)
Definition at line 992 of file IBNLearner_inl.h.
References dag2BN_.
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMdisableEpsilon | ( | ) |
Disable the min log-likelihood diff stopping criterion.
References BNLearner(), and EMdisableEpsilon().
Referenced by EMdisableEpsilon().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMdisableMaxIter | ( | ) |
Disable stopping criterion on max iterations.
References BNLearner(), and EMdisableMaxIter().
Referenced by EMdisableMaxIter().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMdisableMaxTime | ( | ) |
Disable EM's timeout stopping criterion.
References BNLearner(), and EMdisableMaxTime().
Referenced by EMdisableMaxTime().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMdisableMinEpsilonRate | ( | ) |
Disable the log-likelihood evolution rate stopping criterion.
References BNLearner(), and EMdisableMinEpsilonRate().
Referenced by EMdisableMinEpsilonRate().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMenableEpsilon | ( | ) |
Enable the log-likelihood min diff stopping criterion in EM.
References BNLearner(), and EMenableEpsilon().
Referenced by EMenableEpsilon().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMenableMaxIter | ( | ) |
Enable stopping criterion on max iterations.
References BNLearner(), and EMenableMaxIter().
Referenced by EMenableMaxIter().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMenableMaxTime | ( | ) |
enable EM's timeout stopping criterion
References BNLearner(), and EMenableMaxTime().
Referenced by EMenableMaxTime().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMenableMinEpsilonRate | ( | ) |
Enable the log-likelihood evolution rate stopping criterion.
References BNLearner(), and EMenableMinEpsilonRate().
Referenced by EMenableMinEpsilonRate().
|
inherited |
Get the value of EM's min diff epsilon.
Get the value of EM's min diff epsilon
Definition at line 958 of file IBNLearner_inl.h.
References dag2BN_.
|
inherited |
returns the history of the last EM execution
Definition at line 1015 of file IBNLearner_inl.h.
References dag2BN_.
|
inherited |
return true if EM's stopping criterion is the log-likelihood min diff
Definition at line 964 of file IBNLearner_inl.h.
References dag2BN_.
|
inherited |
Definition at line 986 of file IBNLearner_inl.h.
References dag2BN_.
|
inherited |
Definition at line 998 of file IBNLearner_inl.h.
References dag2BN_.
|
inherited |
Definition at line 974 of file IBNLearner_inl.h.
References dag2BN_.
|
inherited |
return the max number of iterations criterion
Definition at line 980 of file IBNLearner_inl.h.
References dag2BN_.
|
inherited |
@brief returns EM's timeout (in milliseconds)
Definition at line 990 of file IBNLearner_inl.h.
References dag2BN_.
|
inherited |
Get the value of the minimal log-likelihood evolution rate of EM.
Definition at line 968 of file IBNLearner_inl.h.
References dag2BN_.
|
inherited |
returns the number of iterations performed by the last EM execution
Definition at line 1013 of file IBNLearner_inl.h.
References dag2BN_.
| INLINE Size gum::learning::IBNLearner::EMPeriodSize | ( | ) | const |
Definition at line 1569 of file IBNLearner_inl.h.
Referenced by EMsetPeriodSize().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMsetEpsilon | ( | const double | eps | ) |
sets the stopping criterion of EM as being the minimal difference between two consecutive log-likelihoods
| eps | the log-likelihood difference below which EM stops its iterations |
| OutOfBounds | if eps <= 0 |
References BNLearner(), and EMsetEpsilon().
Referenced by EMsetEpsilon().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMsetMaxIter | ( | const Size | max | ) |
add a max iteration stopping criterion
| max | the max number of iterations that EM is allowed to perform |
| OutOfBounds | if max<=1 |
References BNLearner(), and EMsetMaxIter().
Referenced by EMsetMaxIter().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMsetMaxTime | ( | const double | timeout | ) |
add a stopping criterion on timeout
| timeout | the timeout in milliseconds |
| OutOfBounds | if timeout<=0.0 |
References BNLearner(), and EMsetMaxTime().
Referenced by EMsetMaxTime().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMsetMinEpsilonRate | ( | const double | rate | ) |
sets the stopping criterion of EM as being the minimal log-likelihood's evolution rate
| rate | the log-likelihood evolution rate below which EM stops its iterations |
| OutOfBounds | if rate<=0 |
References BNLearner(), and EMsetMinEpsilonRate().
Referenced by EMsetMinEpsilonRate().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMsetPeriodSize | ( | const Size | p | ) |
how many samples between 2 stoppings isEnabled
| OutOfBounds | if p<1 |
References BNLearner(), gum::learning::IBNLearner::IBNLearner(), EMPeriodSize(), and EMsetPeriodSize().
Referenced by EMsetPeriodSize().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::EMsetVerbosity | ( | const bool | v | ) |
sets or unsets EM's verbosity
References BNLearner(), and EMsetVerbosity().
Referenced by EMsetVerbosity().
|
inherited |
returns the state of the last EM algorithm executed
Definition at line 442 of file IBNLearner_inl.h.
References dag2BN_, gum::IApproximationSchemeConfiguration::Undefined, and useEM_.
|
inherited |
|
inherited |
|
inherited |
returns the EM's verbosity status
Definition at line 1006 of file IBNLearner_inl.h.
References dag2BN_.
|
overridevirtualinherited |
Enable stopping criterion on epsilon.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 804 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
Enable stopping criterion on max iterations.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 866 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
stopping criterion on timeout If the criterion was disabled it will be enabled
| OutOfBounds | if timeout<=0.0 timeout is time in second (double). |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 902 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
Enable stopping criterion on epsilon rate.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 835 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
Get the value of epsilon.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 792 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
Referenced by gum::learning::BNLearner< GUM_SCALAR >::useEM(), useEM(), gum::learning::BNLearner< GUM_SCALAR >::useEMWithDiffCriterion(), useEMWithDiffCriterion(), gum::learning::BNLearner< GUM_SCALAR >::useEMWithRateCriterion(), and useEMWithRateCriterion().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseForbiddenArc | ( | const Arc & | arc | ) |
References BNLearner(), and eraseForbiddenArc().
Referenced by eraseForbiddenArc(), eraseForbiddenArc(), and eraseForbiddenArc().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseForbiddenArc | ( | NodeId | tail, |
| NodeId | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseForbiddenArc | ( | std::string_view | tail, |
| std::string_view | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseMandatoryArc | ( | const Arc & | arc | ) |
References BNLearner(), and eraseMandatoryArc().
Referenced by eraseMandatoryArc(), eraseMandatoryArc(), and eraseMandatoryArc().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseMandatoryArc | ( | NodeId | tail, |
| NodeId | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseMandatoryArc | ( | std::string_view | tail, |
| std::string_view | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseNoChildrenNode | ( | NodeId | node | ) |
References BNLearner(), and eraseNoChildrenNode().
Referenced by eraseNoChildrenNode(), and eraseNoChildrenNode().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseNoChildrenNode | ( | std::string_view | name | ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseNoParentNode | ( | NodeId | node | ) |
References BNLearner(), and eraseNoParentNode().
Referenced by eraseNoParentNode(), and eraseNoParentNode().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::eraseNoParentNode | ( | std::string_view | name | ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::erasePossibleEdge | ( | const Edge & | edge | ) |
References BNLearner(), and erasePossibleEdge().
Referenced by erasePossibleEdge(), erasePossibleEdge(), and erasePossibleEdge().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::erasePossibleEdge | ( | NodeId | tail, |
| NodeId | head ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::erasePossibleEdge | ( | std::string_view | tail, |
| std::string_view | head ) |
| bool gum::learning::BNLearner< GUM_SCALAR >::fciExhaustiveSepSet | ( | ) | const |
References fciExhaustiveSepSet().
Referenced by fciExhaustiveSepSet().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::forbidEM | ( | ) |
prevent using the EM algorithm for parameter learning
References BNLearner(), and forbidEM().
Referenced by forbidEM().
|
inherited |
Return the <statistic,pvalue> pair for for G2 test in the database.
| id1 | first variable |
| id2 | second variable |
| knowing | list of observed variables |
Definition at line 1357 of file IBNLearner.cpp.
References createPrior_(), databaseRanges(), prior_, scoreDatabase_, and gum::learning::IndepTestG2::statistics().
Referenced by G2().
|
inherited |
Return the <statistic,pvalue> pair for for G2 test in the database.
| id1 | first variable |
| id2 | second variable |
| knowing | list of observed variables |
Definition at line 1363 of file IBNLearner.cpp.
References G2(), and idFromName().
|
nodiscardoverridevirtualinherited |
returns the current max number of threads used by the class containing this ThreadNumberManager
Implements gum::IThreadNumberManager.
Referenced by gum::learning::IBNLearner::createParamEstimator_(), gum::learning::IBNLearner::createScore_(), gum::credal::InferenceEngine< GUM_SCALAR >::dispatchMarginalsToThreads_(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::expFusion_(), gum::ScheduledInference::scheduler(), and gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::verticesFusion_().
|
protectedinherited |
returns the type (as a string) of a given prior
Definition at line 689 of file IBNLearner_inl.h.
References BDEU, gum::learning::BDeuPriorType, DIRICHLET_FROM_BAYESNET, DIRICHLET_FROM_DATABASE, gum::learning::DirichletPriorType, GUM_ERROR, NO_prior, gum::learning::NoPriorType, priorType_, SMOOTHING, and gum::learning::SmoothingPriorType.
Referenced by checkScorePriorCompatibility().
| bool gum::learning::BNLearner< GUM_SCALAR >::greedyThickThinningReversals | ( | ) | const |
References greedyThickThinningReversals().
Referenced by greedyThickThinningReversals().
|
inherited |
returns true if the learner's database has missing values
Definition at line 467 of file IBNLearner_inl.h.
References scoreDatabase_.
Referenced by rawPseudoCount().
|
overridevirtualinherited |
| OperationNotAllowed | if scheme not performed or verbosity=false |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 949 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
inherited |
returns the node id corresponding to a variable name
| MissingVariableInDatabase | if a variable of the BN is not found in the database. |
Definition at line 136 of file IBNLearner_inl.h.
References scoreDatabase_.
Referenced by addForbiddenArc(), addMandatoryArc(), addNoChildrenNode(), addNoParentNode(), addPossibleEdge(), chi2(), correctedMutualInformation(), domainSize(), eraseForbiddenArc(), eraseMandatoryArc(), eraseNoChildrenNode(), eraseNoParentNode(), erasePossibleEdge(), G2(), logLikelihood(), mutualInformation(), rawPseudoCount(), score(), setSliceOrder(), and setTotalOrder().
|
inherited |
returns the initial DAG structure
Definition at line 166 of file IBNLearner_inl.h.
References initialDag_.
| bool gum::learning::BNLearner< GUM_SCALAR >::isConstraintBased | ( | ) | const |
References isConstraintBased().
Referenced by isConstraintBased().
|
staticprotectedinherited |
checks whether the extension of a CSV filename is correct
Definition at line 429 of file IBNLearner.cpp.
References GUM_ERROR.
Referenced by gum::learning::IBNLearner::Database::Database(), gum::learning::IBNLearner::Database::Database(), and readFile_().
|
overridevirtualinherited |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 811 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
overridevirtualinherited |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 873 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
overridevirtualinherited |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 909 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
overridevirtualinherited |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 842 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
nodiscardoverridevirtualinherited |
indicates whether the class containing this ThreadNumberManager set its own number of threads
Implements gum::IThreadNumberManager.
Referenced by gum::learning::IBNLearner::createParamEstimator_(), and gum::learning::IBNLearner::createScore_().
| bool gum::learning::BNLearner< GUM_SCALAR >::isScoreBased | ( | ) | const |
References isScoreBased().
Referenced by isScoreBased().
|
inherited |
indicates whether we use EM for parameter learning
Definition at line 433 of file IBNLearner_inl.h.
References useEM_.
|
inherited |
get the list of arcs hiding latent variables
| OperationNotAllowed | when MIIC is not the selected algorithm |
Definition at line 345 of file IBNLearner_inl.h.
References algoMiic_.
| BayesNet< GUM_SCALAR > gum::learning::BNLearner< GUM_SCALAR >::learnBN | ( | ) |
|
inherited |
learn a structure from a file (must have read the db before)
Definition at line 956 of file IBNLearner.cpp.
References createPrior_(), createScore_(), learnDag_(), and scoreDatabase_.
|
protectedinherited |
returns the DAG learnt
Definition at line 985 of file IBNLearner.cpp.
References gum::DAG::addArc(), gum::NodeGraphPart::addNodeWithId(), algoFCI_, algoK2_, algoMiic_, algoPC_, allowArcAdditions_, allowArcDeletions_, allowArcReversals_, allowArcTriangleDeletions_, constraintForbiddenArcs_, constraintIndegree_, constraintMandatoryArcs_, constraintNoChildrenNodes_, constraintNoParentNodes_, constraintPossibleEdges_, constraintSliceOrder_, constraintTabuList_, constraintTotalOrder_, DIRICHLET_FROM_DATABASE, gum::ArcGraphPart::eraseArc(), gum::NodeGraphPart::exists(), EXTENDED_GREEDY_HILL_CLIMBING, extendedGreedyHillClimbing_, FCI, GREEDY_HILL_CLIMBING, GREEDY_THICK_THINNING, greedyHillClimbing_, greedyThickThinning_, GUM_ERROR, initialDag_, K2, LOCAL_SEARCH_WITH_TABU_LIST, localSearchWithTabuList_, MIIC, mutualInfo_, PC, gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::pos(), prepareFCI_(), prepareMiic_(), preparePC_(), priorDatabase_, priorType_, score_, scoreDatabase_, selectedAlgo_, gum::learning::GraphChangesSelector4DiGraph< INVARIABLE_CONSTRAINT_TYPE, VARIABLE_CONSTRAINT_TYPE >::useArcAdditions(), gum::learning::GraphChangesSelector4DiGraph< INVARIABLE_CONSTRAINT_TYPE, VARIABLE_CONSTRAINT_TYPE >::useArcDeletions(), gum::learning::GraphChangesSelector4DiGraph< INVARIABLE_CONSTRAINT_TYPE, VARIABLE_CONSTRAINT_TYPE >::useArcReversals(), and gum::learning::GraphChangesSelector4DiGraph< INVARIABLE_CONSTRAINT_TYPE, VARIABLE_CONSTRAINT_TYPE >::useArcTriangleDeletions().
Referenced by learnDAG().
|
inherited |
learn a PAG — only valid when useFCI() has been called
| OperationNotAllowed | when FCI is not the selected algorithm |
Definition at line 948 of file IBNLearner.cpp.
References learnPAG_(), and scoreDatabase_.
|
protectedinherited |
Definition at line 934 of file IBNLearner.cpp.
References algoFCI_, FCI, GUM_ERROR, prepareFCI_(), scoreDatabase_, and selectedAlgo_.
Referenced by learnPAG().
| BayesNet< GUM_SCALAR > gum::learning::BNLearner< GUM_SCALAR >::learnParameters | ( | bool | take_into_account_score = true | ) |
learns a BN (its parameters) when its structure is known
| take_into_account_score | The dag of the BN which was passed in argument to the BNLearner may have been learnt from a structure learning. In this case, if the score used to learn the structure has an implicit prior (like K2 which has a 1-smoothing prior), it is important to also take into account this implicit prior for parameter learning. By default, if a score exists, we will learn parameters by taking into account the prior specified by methods usePriorXXX () + the implicit prior of the score, else we just take into account the prior specified by usePriorXXX () |
| MissingVariableInDatabase | if a variable of the BN is not found in the database. |
| UnknownLabelInDatabase | if a label is found in the databast that do not correpond to the variable. |
| OperationNotAllowed | if EM is used but neither the min log-likelihood difference nor the min log-likelihood evolution rate have been selected as stopping criteria |
References learnParameters().
| BayesNet< GUM_SCALAR > gum::learning::BNLearner< GUM_SCALAR >::learnParameters | ( | const BayesNet< GUM_SCALAR > & | bn, |
| bool | takeIntoAccountScore = true ) |
learns a BN (its parameters) with the BN structure passed in argument, EM being initialized by this argument
| bn | the Bayesian network used to specify the graphical structure of the returned Bayes net and to initialize its CPTs before running EM. When a CPT is filled exclusively with only zeroes, then this one is initialized by the BNLearner using a specific estimator that does not take into account the missing values in the database |
| takeIntoAccountScore | The dag passed in argument may have been learnt from a structure learning. In this case, if the score used to learn the structure has an implicit prior (like K2 which has a 1-smoothing prior), it is important to also take into account this implicit prior for parameter learning. By default, if a score exists, we will learn parameters by taking into account the prior specified by methods usePriorXXX () + the implicit prior of the score, else we just take into account the prior specified by usePriorXXX () |
| MissingVariableInDatabase | if a variable of the BN is not found in the database. |
| OperationNotAllowed | if EM is used but no EM stopping criterion has been selected. |
References learnParameters().
| BayesNet< GUM_SCALAR > gum::learning::BNLearner< GUM_SCALAR >::learnParameters | ( | const DAG & | dag, |
| bool | takeIntoAccountScore = true ) |
learns a BN (its parameters) with the structure passed in argument
| dag | the structure of the Bayesian network |
| takeIntoAccountScore | The dag passed in argument may have been learnt from a structure learning. In this case, if the score used to learn the structure has an implicit prior (like K2 which has a 1-smoothing prior), it is important to also take into account this implicit prior for parameter learning. By default, if a score exists, we will learn parameters by taking into account the prior specified by methods usePriorXXX () + the implicit prior of the score, else we just take into account the prior specified by usePriorXXX () |
| MissingVariableInDatabase | if a variable of the BN is not found in the database. |
| MissingValueInDatabase | if the database contains some missing values and EM is not used for the learning. |
| OperationNotAllowed | if EM is used but no EM stopping criterion has been selected. |
References learnParameters().
Referenced by learnParameters(), learnParameters(), and learnParameters().
|
inherited |
learn a partial structure from a file (must have read the db before and must have selected miic)
Definition at line 926 of file IBNLearner.cpp.
References learnPDAG_(), and scoreDatabase_.
|
protectedinherited |
Definition at line 893 of file IBNLearner.cpp.
References algoFCI_, algoMiic_, algoPC_, FCI, GUM_ERROR, MIIC, mutualInfo_, PC, prepareFCI_(), prepareMiic_(), preparePC_(), scoreDatabase_, and selectedAlgo_.
Referenced by learnPDAG().
|
inherited |
Return the loglikelihood of vars in the base, conditioned by knowing for the BNLearner.
| vars | a vector of NodeIds |
| knowing | an optional vector of conditioning NodeIds |
Definition at line 1374 of file IBNLearner.cpp.
References createPrior_(), databaseRanges(), prior_, gum::learning::ScoreLog2Likelihood::score(), and scoreDatabase_.
Referenced by logLikelihood().
|
inherited |
Return the loglikelihood of vars in the base, conditioned by knowing for the BNLearner.
| vars | a vector of name of rows |
| knowing | an optional vector of conditioning rows |
Definition at line 1390 of file IBNLearner.cpp.
References idFromName(), and logLikelihood().
|
overridevirtualinherited |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 854 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
overridevirtualinherited |
returns the timeout (in seconds)
Implements gum::IApproximationSchemeConfiguration.
Definition at line 885 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
inherited |
Returns the approximation scheme message.
Definition at line 64 of file IApproximationSchemeConfiguration.cpp.
References Continue, Epsilon, epsilon(), Limit, maxIter(), maxTime(), minEpsilonRate(), Rate, stateApproximationScheme(), Stopped, TimeLimit, and Undefined.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::credal::InferenceEngine< GUM_SCALAR >::getApproximationSchemeMsg(), and gum::credal::MultipleInferenceEngine< GUM_SCALAR, LazyPropagation< GUM_SCALAR > >::isEnabledMaxIter().
|
overridevirtualinherited |
Get the value of the minimal epsilon rate.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 823 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
inherited |
Return the mutual information of id1 and id2 in the base, conditioned by knowing for the BNLearner.
| id1 | nodeId |
| id2 | nodeId |
| knowing | an optional vector of conditioning NodeIds |
Definition at line 1440 of file IBNLearner.cpp.
References databaseRanges(), gum::learning::CorrectedMutualInformation::score(), scoreDatabase_, and gum::learning::CorrectedMutualInformation::useNoCorr().
Referenced by mutualInformation().
|
inherited |
Return the mutual information of var1 and var2 in the base, conditioned by knowing for the BNLearner.
| var1 | name of a row |
| var2 | name of a row |
| knowing | an optional vector of conditioning rows |
Definition at line 1451 of file IBNLearner.cpp.
References idFromName(), and mutualInformation().
|
inherited |
returns the variable name corresponding to a given node id
Definition at line 141 of file IBNLearner_inl.h.
References scoreDatabase_.
|
inherited |
returns the names of the variables in the database
Definition at line 705 of file IBNLearner_inl.h.
References scoreDatabase_.
|
inherited |
Definition at line 736 of file IBNLearner_inl.h.
References scoreDatabase_.
|
overridevirtualinherited |
| OperationNotAllowed | if scheme not performed |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 944 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
inherited |
Definition at line 738 of file IBNLearner_inl.h.
References scoreDatabase_.
|
noexcept |
| BNLearner & gum::learning::BNLearner< GUM_SCALAR >::operator= | ( | const BNLearner< GUM_SCALAR > & | ) |
|
overridevirtualinherited |
how many samples between 2 stopping isEnableds
| OutOfBounds | if p<1 |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 921 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
protectedinherited |
prepares the initial graph and independence test for FCI
Definition at line 803 of file IBNLearner.cpp.
References gum::DAG::addArc(), gum::DiGraph::addArc(), gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNodeWithId(), algoFCI_, alphaFci_, Chi2, constraintForbiddenArcs_, constraintIndegree_, constraintMandatoryArcs_, constraintNoChildrenNodes_, constraintNoParentNodes_, constraintPossibleEdges_, constraintSliceOrder_, constraintTotalOrder_, gum::Set< Key >::empty(), exhaustiveSepSetFci_, indepTestFCI_, indepTestTypeFCI_, maxPathLengthFci_, gum::NodeGraphPart::nodes(), noPrior_, ranges_, and scoreDatabase_.
Referenced by learnDag_(), learnPAG_(), and learnPDAG_().
|
protectedinherited |
prepares the initial graph for miic
Definition at line 611 of file IBNLearner.cpp.
References gum::DAG::addArc(), gum::DiGraph::addArc(), gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNodeWithId(), algoMiic_, constraintForbiddenArcs_, constraintIndegree_, constraintMandatoryArcs_, constraintNoChildrenNodes_, constraintNoParentNodes_, constraintPossibleEdges_, constraintSliceOrder_, constraintTotalOrder_, createCorrectedMutualInformation_(), gum::Set< Key >::empty(), gum::NodeGraphPart::nodes(), and scoreDatabase_.
Referenced by learnDag_(), and learnPDAG_().
|
protectedinherited |
prepares the initial graph and independence test for PC
Definition at line 710 of file IBNLearner.cpp.
References gum::DAG::addArc(), gum::DiGraph::addArc(), gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNodeWithId(), algoPC_, alphaPc_, Chi2, constraintForbiddenArcs_, constraintIndegree_, constraintMandatoryArcs_, constraintNoChildrenNodes_, constraintNoParentNodes_, constraintPossibleEdges_, constraintSliceOrder_, constraintTotalOrder_, gum::Set< Key >::empty(), indepTestPC_, indepTestTypePC_, maxCondSetSizePc_, gum::NodeGraphPart::nodes(), noPrior_, ranges_, scoreDatabase_, gum::learning::CIBasedLearning::Sorted, sortedUCPc_, stablePc_, and gum::learning::CIBasedLearning::Standard.
Referenced by learnDag_(), and learnPDAG_().
|
protectedinherited |
prepares the initial graph for Simple Miic
|
inherited |
Return the pseudo-counts of NodeIds vars in the base in a raw array.
| vars | a vector of |
Definition at line 1481 of file IBNLearner.cpp.
References createPrior_(), databaseRanges(), gum::learning::PseudoCount::get(), GUM_ERROR, hasMissingValues(), prior_, and scoreDatabase_.
Referenced by rawPseudoCount().
|
inherited |
Return the pseudoconts of vars in the base in a raw array.
| vars | a vector of name |
Definition at line 1496 of file IBNLearner.cpp.
References idFromName(), and rawPseudoCount().
|
staticprotectedinherited |
reads a file and returns a databaseVectInRam
Definition at line 446 of file IBNLearner.cpp.
References database(), gum::learning::IDBInitializer::fillDatabase(), gum::learning::DBTranslatorSet::insertTranslator(), isCSVFileName_(), and gum::learning::IDBInitializer::variableNames().
Referenced by gum::learning::IBNLearner::Database::Database().
|
inherited |
returns the weight of the ith record
| OutOfBounds | if i is outside the set of indices of the records |
Definition at line 156 of file IBNLearner_inl.h.
References scoreDatabase_.
|
inherited |
Return the value of the score currently in use by the BNLearner of a variable given a set of other variables.
| var | the NodeId of the LHS variable |
| knowing | an optional vector of conditioning variables, specified by their NodeIds |
Definition at line 1463 of file IBNLearner.cpp.
References createPrior_(), createScore_(), and score_.
Referenced by score(), and useDatabaseRanges().
|
inherited |
Return the value of the score currently in use by the BNLearner of a variable given a set of other variables The score used is the one currently selected in the BNLearner.
| var | the name of the variable |
| knowing | an optional vector of conditioning variables, specified by their names |
Definition at line 1470 of file IBNLearner.cpp.
References idFromName(), and score().
|
inherited |
{@ /// distribute signals
Definition at line 767 of file IBNLearner_inl.h.
References currentAlgorithm_.
Referenced by gum::learning::BNLearnerListener::BNLearnerListener(), distributeProgress(), and distributeStop().
|
inherited |
assign a weight to all the rows of the learning 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 146 of file IBNLearner_inl.h.
References scoreDatabase_.
|
overridevirtualinherited |
Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)| If the criterion was disabled it will be enabled.
| OutOfBounds | if eps<0 |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 785 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setFCIAlpha | ( | double | alpha | ) |
References BNLearner(), and setFCIAlpha().
Referenced by setFCIAlpha().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setFCIExhaustiveSepSet | ( | bool | exhaustive | ) |
References BNLearner(), and setFCIExhaustiveSepSet().
Referenced by setFCIExhaustiveSepSet().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setFCIMaxPathLength | ( | Size | max_len | ) |
References BNLearner(), and setFCIMaxPathLength().
Referenced by setFCIMaxPathLength().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setForbiddenArcs | ( | const ArcSet & | set | ) |
References BNLearner(), and setForbiddenArcs().
Referenced by setForbiddenArcs().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setGreedyThickThinningReversals | ( | bool | allow | ) |
References BNLearner(), and setGreedyThickThinningReversals().
Referenced by setGreedyThickThinningReversals().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setInitialDAG | ( | const DAG & | dag | ) |
References BNLearner(), and setInitialDAG().
Referenced by setInitialDAG().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setMandatoryArcs | ( | const ArcSet & | set | ) |
References BNLearner(), and setMandatoryArcs().
Referenced by setMandatoryArcs().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setMaxIndegree | ( | Size | max_indegree | ) |
References BNLearner(), and setMaxIndegree().
Referenced by setMaxIndegree().
|
overridevirtualinherited |
stopping criterion on number of iterationsIf the criterion was disabled it will be enabled
| max | The maximum number of iterations |
| OutOfBounds | if max<=1 |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 847 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
stopping criterion on timeout If the criterion was disabled it will be enabled
| OutOfBounds | if timeout<=0.0 timeout is time in second (double). |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 878 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|) If the criterion was disabled it will be enabled.
| OutOfBounds | if rate<0 |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 816 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
|
overridevirtualinherited |
sets the number max of threads that can be used
| nb | the number max of threads to be used. If this number is set to 0, then it is defaulted to aGrUM's max number of threads |
Implements gum::IThreadNumberManager.
Definition at line 741 of file IBNLearner_inl.h.
References score_, and gum::ThreadNumberManager::setNumberOfThreads().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setPCAlpha | ( | double | alpha | ) |
References BNLearner(), and setPCAlpha().
Referenced by setPCAlpha().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setPCMaxCondSetSize | ( | Size | max_k | ) |
References BNLearner(), and setPCMaxCondSetSize().
Referenced by setPCMaxCondSetSize().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setPCStable | ( | bool | stable | ) |
References BNLearner(), and setPCStable().
Referenced by setPCStable().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setPCUnshieldedColliderSorted | ( | bool | sorted | ) |
References BNLearner(), and setPCUnshieldedColliderSorted().
Referenced by setPCUnshieldedColliderSorted().
|
overridevirtualinherited |
how many samples between 2 stopping isEnableds
| OutOfBounds | if p<1 |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 914 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setPossibleEdges | ( | const EdgeSet & | set | ) |
References BNLearner(), and setPossibleEdges().
Referenced by setPossibleEdges().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setPossibleSkeleton | ( | const UndiGraph & | skeleton | ) |
References BNLearner(), and setPossibleSkeleton().
Referenced by setPossibleSkeleton().
|
inherited |
sets the weight of the ith record of the database
assign new weight to the ith row of the learning database
| OutOfBounds | if i is outside the set of indices of the records or if the weight is negative |
Definition at line 151 of file IBNLearner_inl.h.
References scoreDatabase_.
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setSliceOrder | ( | const NodeProperty< NodeId > & | slice_order | ) |
References BNLearner(), and setSliceOrder().
Referenced by setSliceOrder(), and setSliceOrder().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setSliceOrder | ( | const std::vector< std::vector< std::string > > & | slices | ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setTotalOrder | ( | const Sequence< NodeId > & | order | ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::setTotalOrder | ( | const std::vector< std::string > & | order | ) |
References BNLearner(), and setTotalOrder().
Referenced by setTotalOrder(), and setTotalOrder().
|
overridevirtualinherited |
verbosity
Implements gum::IApproximationSchemeConfiguration.
Definition at line 926 of file IBNLearner_inl.h.
References algoK2_, dag2BN_, greedyHillClimbing_, and localSearchWithTabuList_.
| std::vector< std::tuple< std::string, std::string, std::string > > gum::learning::BNLearner< GUM_SCALAR >::state | ( | ) | const |
|
overridevirtualinherited |
history
Implements gum::IApproximationSchemeConfiguration.
Definition at line 939 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
| std::string gum::learning::BNLearner< GUM_SCALAR >::toString | ( | ) | const |
References toString().
Referenced by toString().
|
inherited |
removes the slice order constraint
The methd is useful if you had previously added a slice order constraint and you do not want to use it anymore
Definition at line 624 of file IBNLearner_inl.h.
References setSliceOrder().
|
inherited |
removes the current total ordering constraint, if any
Definition at line 641 of file IBNLearner_inl.h.
References setTotalOrder().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useBDeuPrior | ( | double | weight = 1.0 | ) |
References BNLearner(), and useBDeuPrior().
Referenced by useBDeuPrior().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useChi2Test | ( | ) |
References BNLearner(), and useChi2Test().
Referenced by useChi2Test().
|
inherited |
sets the ranges of rows to be used for cross-validation learning
When applied on (x,k), the method indicates to the subsequent learnings that they should be performed on the xth fold in a k-fold cross-validation context. For instance, if a database has 1000 rows, and if we perform a 10-fold cross-validation, then, the first learning fold (learning_fold=0) corresponds to rows interval [100,1000) and the test dataset corresponds to [0,100). The second learning fold (learning_fold=1) is [0,100) U [200,1000) and the corresponding test dataset is [100,200).
| learning_fold | a number indicating the set of rows used for learning. If N denotes the size of the database, and k_fold represents the number of folds in the cross validation, then the set of rows used for testing is [learning_fold * N / k_fold, (learning_fold+1) * N / k_fold) and the learning database is the complement in the database |
| k_fold | the value of "k" in k-fold cross validation |
| OutOfBounds | is raised if k_fold is equal to 0 or learning_fold is greater than or eqal to k_fold, or if k_fold is greater than or equal to the size of the database. |
Definition at line 1299 of file IBNLearner.cpp.
References GUM_ERROR, ranges_, and scoreDatabase_.
|
inherited |
use a new set of database rows' ranges to perform learning
| ranges | a set of pairs {(X1,Y1),...,(Xn,Yn)} of database's rows indices. The subsequent learnings are then performed only on the union of the rows [Xi,Yi), i in {1,...,n}. This is useful, e.g, when performing cross validation tasks, in which part of the database should be ignored. An empty set of ranges is equivalent to an interval [X,Y) ranging over the whole database. |
Definition at line 1506 of file IBNLearner.cpp.
References noPrior_, ranges_, score(), and scoreDatabase_.
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useDirichletPrior | ( | const gum::BayesNet< GUM_SCALAR > & | bn, |
| double | weight = 1 ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useDirichletPrior | ( | std::string_view | filename, |
| double | weight = 1 ) |
References BNLearner(), and useDirichletPrior().
Referenced by useDirichletPrior(), and useDirichletPrior().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useEM | ( | const double | epsilon, |
| const double | noise = default_EM_noise ) |
use The EM algorithm to learn parameters
This is essentially an alias for Method useEMWithRateCriterion().
| epsilon | sets the approximation stopping criterion: EM stops whenever the absolute value of the relative difference between two consecutive log-likelihoods drops below epsilon. Note that epsilon=0 is considered as a directive to not use EM. However, if you wish to forbid the use of EM, prefer executing Method forbidEM() rather than useEM(0) as it is more unequivocal. |
| noise | When EM starts, it initializes all the CPTs of the Bayes net. EM adds a noise to these CPTs by mixing their values with some random noise. The formula used is, up to some normalizing constant: new_cpt = (1-noise) * cpt + noise * random_cpt(). Of course, noise must belong to interval [0,1]. |
| OutOfBounds | is raised if epsilon is strictly negative or if noise does not belong to interval [0,1]. |
References BNLearner(), gum::learning::IBNLearner::default_EM_noise, gum::learning::IBNLearner::epsilon(), and useEM().
Referenced by useEM().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useEMWithDiffCriterion | ( | const double | epsilon, |
| const double | noise = default_EM_noise ) |
use The EM algorithm to learn parameters with the diff stopping criterion
| epsilon | epsilon sets the approximation stopping criterion: EM stops whenever the difference between two consecutive log-likelihoods drops below epsilon. Note that, for using EM, epsilon should be strictly positive. |
| noise | When EM starts, it initializes all the CPTs of the Bayes net. EM adds a noise to these CPTs by mixing their values with some random noise. The formula used is, up to some normalizing constant: new_cpt = (1-noise) * cpt + noise * random_cpt(). Of course, noise must belong to interval [0,1]. |
| OutOfBounds | is raised if epsilon is not strictly positive or if noise does not belong to interval [0,1]. |
References BNLearner(), gum::learning::IBNLearner::default_EM_noise, gum::learning::IBNLearner::epsilon(), and useEMWithDiffCriterion().
Referenced by useEMWithDiffCriterion().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useEMWithRateCriterion | ( | const double | epsilon, |
| const double | noise = default_EM_noise ) |
use The EM algorithm to learn parameters with the rate stopping criterion
| epsilon | epsilon sets the approximation stopping criterion: EM stops whenever the absolute value of the relative difference between two consecutive log-likelihoods drops below epsilon. Note that, for using EM, epsilon should be strictly positive. |
| max_nb_iter | the maximum number of EM iterations allowed. If equal to 0, this stopping criterion is unused. |
| noise | When EM starts, it initializes all the CPTs of the Bayes net. EM adds a noise to these CPTs by mixing their values with some random noise. The formula used is, up to some normalizing constant: new_cpt = (1-noise) * cpt + noise * random_cpt(). Of course, noise must belong to interval [0,1]. |
| OutOfBounds | is raised if epsilon is not strictly positive or if noise does not belong to interval [0,1]. |
References BNLearner(), gum::learning::IBNLearner::default_EM_noise, gum::learning::IBNLearner::epsilon(), and useEMWithRateCriterion().
Referenced by useEMWithRateCriterion().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useExtendedGreedyHillClimbing | ( | ) |
References BNLearner(), and useExtendedGreedyHillClimbing().
Referenced by useExtendedGreedyHillClimbing().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useFCI | ( | ) |
References BNLearner(), and useFCI().
Referenced by useFCI().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useFCIChi2Test | ( | ) |
References BNLearner(), and useFCIChi2Test().
Referenced by useFCIChi2Test().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useFCIG2Test | ( | ) |
References BNLearner(), and useFCIG2Test().
Referenced by useFCIG2Test().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useG2Test | ( | ) |
References BNLearner(), and useG2Test().
Referenced by useG2Test().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useGreedyHillClimbing | ( | ) |
References BNLearner(), and useGreedyHillClimbing().
Referenced by useGreedyHillClimbing().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useGreedyThickThinning | ( | ) |
References BNLearner(), and useGreedyThickThinning().
Referenced by useGreedyThickThinning().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useK2 | ( | const Sequence< NodeId > & | order | ) |
References BNLearner(), and useK2().
Referenced by useK2(), and useK2().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useK2 | ( | const std::vector< NodeId > & | order | ) |
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useLocalSearchWithTabuList | ( | Size | tabu_size = 100, |
| Size | nb_decrease = 2 ) |
References BNLearner(), and useLocalSearchWithTabuList().
Referenced by useLocalSearchWithTabuList().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useMDLCorrection | ( | ) |
References BNLearner(), and useMDLCorrection().
Referenced by useMDLCorrection().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useMIIC | ( | ) |
References BNLearner(), and useMIIC().
Referenced by useMIIC().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useNMLCorrection | ( | ) |
References BNLearner(), and useNMLCorrection().
Referenced by useNMLCorrection().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useNoCorrection | ( | ) |
References BNLearner(), and useNoCorrection().
Referenced by useNoCorrection().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useNoPrior | ( | ) |
References BNLearner(), and useNoPrior().
Referenced by useNoPrior().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::usePC | ( | ) |
References BNLearner(), and usePC().
Referenced by usePC().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useScoreAIC | ( | ) |
References BNLearner(), and useScoreAIC().
Referenced by useScoreAIC().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useScoreBD | ( | ) |
References BNLearner(), and useScoreBD().
Referenced by useScoreBD().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useScoreBDeu | ( | ) |
References BNLearner(), and useScoreBDeu().
Referenced by useScoreBDeu().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useScoreBIC | ( | ) |
References BNLearner(), and useScoreBIC().
Referenced by useScoreBIC().
|
inherited |
indicate that we wish to use a fNML score
Definition at line 193 of file IBNLearner_inl.h.
References checkScorePriorCompatibility(), fNML, and scoreType_.
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useScoreK2 | ( | ) |
References BNLearner(), and useScoreK2().
Referenced by useScoreK2().
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useScoreLog2Likelihood | ( | ) |
References BNLearner(), and useScoreLog2Likelihood().
Referenced by useScoreLog2Likelihood().
|
inherited |
indicate that we wish to use a MDL score
Definition at line 211 of file IBNLearner_inl.h.
References checkScorePriorCompatibility(), MDL, and scoreType_.
| BNLearner< GUM_SCALAR > & gum::learning::BNLearner< GUM_SCALAR >::useSmoothingPrior | ( | double | weight = 1 | ) |
References BNLearner(), and useSmoothingPrior().
Referenced by useSmoothingPrior().
|
overridevirtualinherited |
verbosity
Implements gum::IApproximationSchemeConfiguration.
Definition at line 933 of file IBNLearner_inl.h.
References currentAlgorithm_, and GUM_ERROR.
|
privateinherited |
the max number of threads used by the class
Definition at line 126 of file threadNumberManager.h.
|
private |
Definition at line 542 of file BNLearner.h.
|
protectedinherited |
the FCI algorithm
Definition at line 1222 of file IBNLearner.h.
Referenced by learnDag_(), learnPAG_(), learnPDAG_(), and prepareFCI_().
|
protectedinherited |
the K2 algorithm
Definition at line 1193 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), disableEpsilon(), disableMaxIter(), disableMaxTime(), disableMinEpsilonRate(), enableEpsilon(), enableMaxIter(), enableMaxTime(), enableMinEpsilonRate(), learnDag_(), operator=(), operator=(), setEpsilon(), setMaxIter(), setMaxTime(), setMinEpsilonRate(), setPeriodSize(), setVerbosity(), useK2(), and useK2().
|
protectedinherited |
the Constraint MIIC algorithm
Definition at line 1199 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), latentVariables(), learnDag_(), learnPDAG_(), operator=(), operator=(), and prepareMiic_().
|
protectedinherited |
the PC algorithm
Definition at line 1206 of file IBNLearner.h.
Referenced by learnDag_(), learnPDAG_(), and preparePC_().
|
protectedinherited |
the MIIC algorithm
Definition at line 1196 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), operator=(), and operator=().
|
protectedinherited |
whether we allow or not arc additions during learning
Definition at line 1181 of file IBNLearner.h.
Referenced by allowArcAdditions(), and learnDag_().
|
protectedinherited |
whether we allow or not arc deletions during learning
Definition at line 1184 of file IBNLearner.h.
Referenced by allowArcDeletions(), and learnDag_().
|
protectedinherited |
whether we allow or not arc reversals during learning
Definition at line 1187 of file IBNLearner.h.
Referenced by allowArcReversals(), and learnDag_().
|
protectedinherited |
whether we allow or not arc deletions during learning
Definition at line 1190 of file IBNLearner.h.
Referenced by allowArcTriangleDeletions(), and learnDag_().
|
protectedinherited |
FCI parameters.
Definition at line 1231 of file IBNLearner.h.
Referenced by prepareFCI_(), and setFCIAlpha().
|
protectedinherited |
PC parameters.
Definition at line 1216 of file IBNLearner.h.
Referenced by preparePC_(), and setPCAlpha().
|
protectedinherited |
the constraint on forbidden arcs
Definition at line 1163 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), addForbiddenArc(), eraseForbiddenArc(), learnDag_(), operator=(), operator=(), prepareFCI_(), prepareMiic_(), preparePC_(), and setForbiddenArcs().
|
protectedinherited |
the constraint for indegrees
Definition at line 1157 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), learnDag_(), operator=(), operator=(), prepareFCI_(), prepareMiic_(), preparePC_(), and setMaxIndegree().
|
protectedinherited |
the constraint on mandatory arcs
Definition at line 1169 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), addMandatoryArc(), eraseMandatoryArc(), learnDag_(), operator=(), operator=(), prepareFCI_(), prepareMiic_(), preparePC_(), and setMandatoryArcs().
|
protectedinherited |
the constraint on no children nodes
Definition at line 1175 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), addNoChildrenNode(), eraseNoChildrenNode(), learnDag_(), operator=(), operator=(), prepareFCI_(), prepareMiic_(), and preparePC_().
|
protectedinherited |
the constraint on no parent nodes
Definition at line 1172 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), addNoParentNode(), eraseNoParentNode(), learnDag_(), operator=(), operator=(), prepareFCI_(), prepareMiic_(), and preparePC_().
|
protectedinherited |
the constraint on possible Edges
Definition at line 1166 of file IBNLearner.h.
Referenced by addPossibleEdge(), erasePossibleEdge(), learnDag_(), prepareFCI_(), prepareMiic_(), preparePC_(), and setPossibleEdges().
|
protectedinherited |
the constraint for 2TBNs
Definition at line 1151 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), learnDag_(), operator=(), operator=(), prepareFCI_(), prepareMiic_(), preparePC_(), and setSliceOrder().
|
protectedinherited |
the constraint for tabu lists
Definition at line 1160 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), learnDag_(), operator=(), operator=(), and useLocalSearchWithTabuList().
|
protectedinherited |
the total order ing constraint
Definition at line 1154 of file IBNLearner.h.
Referenced by learnDag_(), prepareFCI_(), prepareMiic_(), preparePC_(), and setTotalOrder().
|
protectedinherited |
Definition at line 1272 of file IBNLearner.h.
Referenced by currentTime(), epsilon(), history(), isEnabledEpsilon(), isEnabledMaxIter(), isEnabledMaxTime(), isEnabledMinEpsilonRate(), maxIter(), maxTime(), minEpsilonRate(), nbrIterations(), operator=(), operator=(), periodSize(), setCurrentApproximationScheme(), stateApproximationScheme(), and verbosity().
|
protectedinherited |
the parametric EM
Definition at line 1236 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), disableEpsilon(), disableMaxIter(), disableMaxTime(), disableMinEpsilonRate(), EM(), EMCurrentTime(), EMdisableEpsilon(), EMdisableMaxIter(), EMdisableMaxTime(), EMdisableMinEpsilonRate(), EMenableEpsilon(), EMenableMaxIter(), EMenableMaxTime(), EMenableMinEpsilonRate(), EMEpsilon(), EMHistory(), EMisEnabledEpsilon(), EMisEnabledMaxIter(), EMisEnabledMaxTime(), EMisEnabledMinEpsilonRate(), EMMaxIter(), EMMaxTime(), EMMinEpsilonRate(), EMnbrIterations(), EMPeriodSize(), EMsetEpsilon(), EMsetMaxIter(), EMsetMaxTime(), EMsetMinEpsilonRate(), EMsetPeriodSize(), EMsetVerbosity(), EMState(), EMStateApproximationScheme(), EMStateMessage(), EMVerbosity(), enableEpsilon(), enableMaxIter(), enableMaxTime(), enableMinEpsilonRate(), operator=(), operator=(), setEpsilon(), setMaxIter(), setMaxTime(), setMinEpsilonRate(), setPeriodSize(), setVerbosity(), useEM(), and useEMWithDiffCriterion().
|
staticconstexprinherited |
the default noise amount added to CPTs during EM's initialization (see method useEM())
Definition at line 135 of file IBNLearner.h.
Referenced by gum::learning::BNLearner< GUM_SCALAR >::useEM(), gum::learning::BNLearner< GUM_SCALAR >::useEMWithDiffCriterion(), and gum::learning::BNLearner< GUM_SCALAR >::useEMWithRateCriterion().
|
protectedinherited |
Definition at line 1233 of file IBNLearner.h.
Referenced by fciExhaustiveSepSet(), prepareFCI_(), and setFCIExhaustiveSepSet().
|
protectedinherited |
the extended greedy hill climbing
Definition at line 1242 of file IBNLearner.h.
Referenced by learnDag_().
|
protectedinherited |
the filename database
Definition at line 1266 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), IBNLearner(), IBNLearner(), operator=(), and operator=().
|
protectedinherited |
the greedy hill climbing algorithm
Definition at line 1239 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), disableEpsilon(), disableMaxIter(), disableMaxTime(), disableMinEpsilonRate(), enableEpsilon(), enableMaxIter(), enableMaxTime(), enableMinEpsilonRate(), learnDag_(), operator=(), operator=(), setEpsilon(), setMaxIter(), setMaxTime(), setMinEpsilonRate(), setPeriodSize(), and setVerbosity().
|
protectedinherited |
the greedy thick-thinning algorithm
Definition at line 1245 of file IBNLearner.h.
Referenced by greedyThickThinningReversals(), learnDag_(), and setGreedyThickThinningReversals().
|
protectedinherited |
owned independence test object for FCI (rebuilt before each learn call)
Definition at line 1228 of file IBNLearner.h.
Referenced by ~IBNLearner(), and prepareFCI_().
|
protectedinherited |
owned independence test object for PC (rebuilt before each learn call)
Definition at line 1213 of file IBNLearner.h.
Referenced by ~IBNLearner(), and preparePC_().
|
protectedinherited |
independence test type for FCI (reuses IndepTestType defined above)
Definition at line 1225 of file IBNLearner.h.
Referenced by prepareFCI_(), useFCIChi2Test(), and useFCIG2Test().
|
protectedinherited |
Definition at line 1210 of file IBNLearner.h.
Referenced by preparePC_(), useChi2Test(), and useG2Test().
|
protectedinherited |
the policy for typing variables
Definition at line 1119 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), IBNLearner(), and IBNLearner().
|
protectedinherited |
an initial DAG given to learners
Definition at line 1263 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), initialDAG(), learnDag_(), operator=(), operator=(), and setInitialDAG().
|
protectedinherited |
the penalty used in MIIC
Definition at line 1202 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), correctedMutualInformation(), createCorrectedMutualInformation_(), operator=(), operator=(), useMDLCorrection(), useNMLCorrection(), and useNoCorrection().
|
protectedinherited |
the local search with tabu list algorithm
Definition at line 1248 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), disableEpsilon(), disableMaxIter(), disableMaxTime(), disableMinEpsilonRate(), enableEpsilon(), enableMaxIter(), enableMaxTime(), enableMinEpsilonRate(), learnDag_(), operator=(), operator=(), setEpsilon(), setMaxIter(), setMaxTime(), setMinEpsilonRate(), setPeriodSize(), setVerbosity(), and useLocalSearchWithTabuList().
Definition at line 1218 of file IBNLearner.h.
Referenced by preparePC_(), and setPCMaxCondSetSize().
Definition at line 1232 of file IBNLearner.h.
Referenced by prepareFCI_(), and setFCIMaxPathLength().
|
protectedinherited |
the selected correction for miic
Definition at line 1137 of file IBNLearner.h.
Referenced by ~IBNLearner(), createCorrectedMutualInformation_(), learnDag_(), learnPDAG_(), operator=(), and operator=().
|
protectedinherited |
Definition at line 1269 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), operator=(), operator=(), and useLocalSearchWithTabuList().
|
protectedinherited |
the noise factor (in (0,1)) used by EM for perturbing the CPT during init
Definition at line 1134 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), operator=(), operator=(), useEM(), and useEMWithDiffCriterion().
|
protectedinherited |
Definition at line 1145 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), IBNLearner(), IBNLearner(), IBNLearner(), ~IBNLearner(), createCorrectedMutualInformation_(), createParamEstimator_(), prepareFCI_(), preparePC_(), and useDatabaseRanges().
Progression, error and time.
Definition at line 81 of file IApproximationSchemeConfiguration.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::learning::IBNLearner::distributeProgress(), gum::learning::Miic::initiation_(), gum::learning::SimpleMiic::initiation_(), gum::learning::Miic::iteration_(), gum::learning::SimpleMiic::iteration_(), gum::learning::SimpleMiic::orientationLatents_(), gum::learning::Miic::orientationMiic_(), and gum::learning::SimpleMiic::orientationMiic_().
|
inherited |
Criteria messageApproximationScheme.
Definition at line 84 of file IApproximationSchemeConfiguration.h.
Referenced by gum::learning::IBNLearner::distributeStop().
|
protectedinherited |
the type of the parameter estimator
Definition at line 1128 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), createParamEstimator_(), operator=(), and operator=().
|
protectedinherited |
the prior used
Definition at line 1143 of file IBNLearner.h.
Referenced by ~IBNLearner(), chi2(), correctedMutualInformation(), createParamEstimator_(), createScore_(), G2(), logLikelihood(), operator=(), operator=(), and rawPseudoCount().
|
protectedinherited |
the database used by the Dirichlet a priori
Definition at line 1257 of file IBNLearner.h.
Referenced by ~IBNLearner(), learnDag_(), operator=(), and operator=().
|
protectedinherited |
the filename for the Dirichlet a priori, if any
Definition at line 1260 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), operator=(), operator=(), and useDirichletPrior().
|
protectedinherited |
the a priorselected for the score and parameters
Definition at line 1140 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), getPriorType_(), learnDag_(), operator=(), operator=(), useBDeuPrior(), useDirichletPrior(), useNoPrior(), and useSmoothingPrior().
|
protectedinherited |
the weight of the prior
Definition at line 1148 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), _setPriorWeight_(), checkScorePriorCompatibility(), operator=(), and operator=().
|
protectedinherited |
the set of rows' ranges within the database in which learning is done
Definition at line 1254 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), clearDatabaseRanges(), createCorrectedMutualInformation_(), createParamEstimator_(), createScore_(), databaseRanges(), operator=(), operator=(), prepareFCI_(), preparePC_(), useCrossValidationFold(), and useDatabaseRanges().
|
protectedinherited |
the score used
Definition at line 1125 of file IBNLearner.h.
Referenced by ~IBNLearner(), createParamEstimator_(), createScore_(), learnDag_(), operator=(), operator=(), score(), and setNumberOfThreads().
|
protectedinherited |
the database to be used by the scores and parameter estimators
Definition at line 1251 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), IBNLearner(), IBNLearner(), IBNLearner(), chi2(), correctedMutualInformation(), createCorrectedMutualInformation_(), createParamEstimator_(), createScore_(), database(), databaseWeight(), domainSize(), domainSize(), domainSizes(), G2(), hasMissingValues(), idFromName(), learnDAG(), learnDag_(), learnPAG(), learnPAG_(), learnPDAG(), learnPDAG_(), logLikelihood(), mutualInformation(), nameFromId(), names(), nbCols(), nbRows(), operator=(), operator=(), prepareFCI_(), prepareMiic_(), preparePC_(), rawPseudoCount(), recordWeight(), setDatabaseWeight(), setRecordWeight(), useCrossValidationFold(), and useDatabaseRanges().
|
protectedinherited |
the score selected for learning
Definition at line 1122 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), checkScorePriorCompatibility(), createScore_(), operator=(), operator=(), useScoreAIC(), useScoreBD(), useScoreBDeu(), useScoreBIC(), useScorefNML(), useScoreK2(), useScoreLog2Likelihood(), and useScoreMDL().
|
protectedinherited |
the selected learning algorithm
Definition at line 1178 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), fciExhaustiveSepSet(), isConstraintBased(), learnDag_(), learnPAG_(), learnPDAG_(), operator=(), operator=(), setFCIAlpha(), setFCIExhaustiveSepSet(), setFCIMaxPathLength(), setPCAlpha(), setPCMaxCondSetSize(), setPCStable(), setPCUnshieldedColliderSorted(), useChi2Test(), useExtendedGreedyHillClimbing(), useFCI(), useFCIChi2Test(), useFCIG2Test(), useG2Test(), useGreedyHillClimbing(), useGreedyThickThinning(), useK2(), useK2(), useLocalSearchWithTabuList(), useMIIC(), and usePC().
|
protectedinherited |
Definition at line 1219 of file IBNLearner.h.
Referenced by preparePC_(), and setPCUnshieldedColliderSorted().
|
protectedinherited |
Definition at line 1217 of file IBNLearner.h.
Referenced by preparePC_(), and setPCStable().
|
protectedinherited |
a Boolean indicating whether we should use EM for parameter learning or not
Definition at line 1131 of file IBNLearner.h.
Referenced by IBNLearner(), IBNLearner(), EM(), EMState(), EMStateMessage(), forbidEM(), isUsingEM(), operator=(), operator=(), useEM(), and useEMWithDiffCriterion().