aGrUM  0.16.0
imddi.h
Go to the documentation of this file.
1 
30 // =========================================================================
31 #ifndef GUM_IMDDI_H
32 #define GUM_IMDDI_H
33 // =========================================================================
35 // =========================================================================
41 // =========================================================================
43 // =========================================================================
44 
45 namespace gum {
46 
57  template < TESTNAME AttributeSelection, bool isScalar = false >
58  class IMDDI : public IncrementalGraphLearner< AttributeSelection, isScalar > {
59  public:
60  // ###################################################################
62  // ###################################################################
64 
65  // ==========================================================================
67  // ==========================================================================
69  double attributeSelectionThreshold,
70  double pairSelectionThreshold,
71  Set< const DiscreteVariable* > attributeListe,
72  const DiscreteVariable* learnedValue);
73 
74  // ==========================================================================
76  // ==========================================================================
78  double attributeSelectionThreshold,
79  double pairSelectionThreshold,
80  Set< const DiscreteVariable* > attributeListe);
81 
82  // ==========================================================================
84  // ==========================================================================
85  ~IMDDI();
86 
88 
89  // ###################################################################
91  // ###################################################################
93 
94  // ==========================================================================
96  // ==========================================================================
97  void addObservation(const Observation*);
98 
99  protected:
100  void _updateNodeWithObservation(const Observation* newObs,
101  NodeId currentNodeId);
102 
103  public:
104  // ==========================================================================
106  // ==========================================================================
107  void updateGraph();
108 
109  protected:
111  const DiscreteVariable* boundVar,
112  Set< const Observation* >* sonsMap);
113 
114  void _chgNodeBoundVar(NodeId chgedNodeId, const DiscreteVariable* desiredVar);
115 
116  void _removeNode(NodeId removedNodeId);
117 
118  private:
119  void __addLeaf(NodeId);
120  void __removeLeaf(NodeId);
121 
123 
124  private:
125  // ###################################################################
127  // ###################################################################
129 
130  // ==========================================================================
132  // ==========================================================================
135 
136  // ==========================================================================
140  // ==========================================================================
141  void
143 
144 
145  public:
146  // ==========================================================================
148  // ==========================================================================
149  void updateFunctionGraph();
150 
151  private:
152  void __rebuildFunctionGraph();
155 
158  public:
161  __varOrder.beginSafe();
162  varIter != __varOrder.endSafe();
163  ++varIter)
164  ret->add(**varIter);
165  }
166 
167  private:
169 
171 
173 
176 
179 
182  // double __pairSelectionThreshold;
183  };
184 
185 
186 } /* namespace gum */
187 
189 
190 #endif // GUM_IMDDI_H
Safe iterators for Sequence.
Definition: sequence.h:1206
void updateGraph()
Updates the tree after a new observation has been added.
Definition: imddi_tpl.h:122
LeafAggregator __lg
Definition: imddi.h:170
NodeId __insertLeafInFunctionGraph(AbstractLeaf *, Int2Type< true >)
Computes the score of the given variables for the given node.
Definition: imddi_tpl.h:391
void __removeLeaf(NodeId)
Adds a new observation to the structure.
Definition: imddi_tpl.h:304
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void addObservation(const Observation *)
Adds a new observation to the structure.
Definition: imddi_tpl.h:101
void _updateNodeWithObservation(const Observation *newObs, NodeId currentNodeId)
Adds a new observation to the structure.
Definition: imddi_tpl.h:108
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void _removeNode(NodeId removedNodeId)
Adds a new observation to the structure.
Definition: imddi_tpl.h:278
void __updateScore(const DiscreteVariable *, NodeId, VariableSelector &vs)
Computes the score of the given variables for the given node.
Definition: imddi_tpl.h:172
<agrum/FMDP/learning/FunctionGraph/leafAggregator.h>
<agrum/FMDP/learning/datastructure/incrementalGraphLearner>
The generic class for storing (ordered) sequences of objects.
Definition: sequence.h:1022
void updateFunctionGraph()
Computes the score of the given variables for the given node.
Definition: imddi_tpl.h:316
<agrum/FMDP/learning/datastructure/leaves/abstractLeaf.h>
Definition: abstractLeaf.h:53
Base class for discrete random variable.
void __rebuildFunctionGraph()
Computes the score of the given variables for the given node.
Definition: imddi_tpl.h:328
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
HashTable< NodeId, AbstractLeaf *> __leafMap
Definition: imddi.h:172
The class for generic Hash Tables.
Definition: hashTable.h:679
Sequence< const DiscreteVariable *> __varOrder
Definition: imddi.h:168
void _chgNodeBoundVar(NodeId chgedNodeId, const DiscreteVariable *desiredVar)
Adds a new observation to the structure.
Definition: imddi_tpl.h:262
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:165
virtual void add(const DiscreteVariable &v)
Adds a new var to the variables of the multidimensional matrix.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
~IMDDI()
Default destructor.
Definition: imddi_tpl.h:86
void __addLeaf(NodeId)
Adds a new observation to the structure.
Definition: imddi_tpl.h:290
void __downdateScore(const DiscreteVariable *, NodeId, VariableSelector &vs)
Computes the score of the given variables for the given node.
Definition: imddi_tpl.h:183
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void insertSetOfVars(MultiDimFunctionGraph< double > *ret) const
Definition: imddi.h:159
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
IMDDI(MultiDimFunctionGraph< double > *target, double attributeSelectionThreshold, double pairSelectionThreshold, Set< const DiscreteVariable * > attributeListe, const DiscreteVariable *learnedValue)
Variable Learner constructor.
Definition: imddi_tpl.h:51
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
<agrum/FMDP/planning/FunctionGraph/variableselector.h>
double __attributeSelectionThreshold
The threshold above which we consider variables to be dependant.
Definition: imddi.h:178
Size Idx
Type for indexes.
Definition: types.h:53
NodeId _insertLeafNode(NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar, Set< const Observation * > *sonsMap)
Adds a new observation to the structure.
Definition: imddi_tpl.h:244
Size NodeId
Type for node ids.
Definition: graphElements.h:98
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __updateNodeSet(Set< NodeId > &, const DiscreteVariable *, VariableSelector &)
For each node in the given set, this methods checks whether or not we should installed the given vari...
Definition: imddi_tpl.h:201
<agrum/FMDP/learning/datastructure/nodeDatabase.h>
Definition: nodeDatabase.h:58
Idx __nbTotalObservation
The total number of observation added to this tree.
Definition: imddi.h:175