aGrUM  0.16.0
iti.h
Go to the documentation of this file.
1 
30 // =========================================================================
31 #ifndef GUM_ITI_H
32 #define GUM_ITI_H
33 // =========================================================================
35 // =========================================================================
37 // =========================================================================
40 // =========================================================================
42 // =========================================================================
43 
44 namespace gum {
45 
61  template < TESTNAME AttributeSelection, bool isScalar = false >
62  class ITI : public IncrementalGraphLearner< AttributeSelection, isScalar > {
63  public:
64  // ###################################################################
66  // ###################################################################
68 
69  // ==========================================================================
81  // ==========================================================================
83  double attributeSelectionThreshold,
84  Set< const DiscreteVariable* > attributeListe,
85  const DiscreteVariable* learnedValue);
86 
87  // ==========================================================================
97  // ==========================================================================
99  double attributeSelectionThreshold,
100  Set< const DiscreteVariable* > attributeListe);
101 
102  // ==========================================================================
104  // ==========================================================================
105  ~ITI() { GUM_DESTRUCTOR(ITI); }
106 
108 
109  // ###################################################################
111  // ###################################################################
113  public:
114  // ==========================================================================
119  // ==========================================================================
120  void addObservation(const Observation* obs);
121 
122  protected:
123  // ==========================================================================
130  // ==========================================================================
131  void _updateNodeWithObservation(const Observation* newObs,
132  NodeId currentNodeId);
133 
135 
136  // ###################################################################
138  // ###################################################################
140  public:
141  // ==========================================================================
143  // ==========================================================================
144  void updateGraph();
145 
146  protected:
147  // ==========================================================================
154  // ==========================================================================
156  const DiscreteVariable* boundVar);
157 
158  // ==========================================================================
164  // ==========================================================================
165  void _chgNodeBoundVar(NodeId chgedNodeId, const DiscreteVariable* desiredVar);
166 
167  // ==========================================================================
172  // ==========================================================================
173  void _removeNode(NodeId removedNodeId);
174 
176 
177  public:
178  // ###################################################################
180  // ###################################################################
182 
183  // ==========================================================================
185  // ==========================================================================
186  void updateFunctionGraph();
187 
188  private:
189  // ==========================================================================
195  // ==========================================================================
197 
198  // ==========================================================================
207  // ==========================================================================
210  }
211 
212  // ==========================================================================
220  // ==========================================================================
222 
223  // ==========================================================================
231  // ==========================================================================
233 
235 
236 
237  protected:
238  // ==========================================================================
243  // ==========================================================================
246  this->_setOfVars.beginSafe();
247  varIter != this->_setOfVars.endSafe();
248  ++varIter)
249  ret->add(**varIter);
250  }
251 
252  private:
257 
260 
263  };
264 
265 
266 } /* namespace gum */
267 
269 
270 #endif // GUM_ITI_H
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void updateFunctionGraph()
Updates target to currently learned graph structure.
Definition: iti_tpl.h:261
NodeId _insertNode(NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar)
inserts a new node in internal graph
Definition: iti_tpl.h:210
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Set< const DiscreteVariable *> _setOfVars
NodeId __insertNodeInFunctionGraph(NodeId src)
Inserts an internal node in the target.
Definition: iti_tpl.h:276
double __attributeSelectionThreshold
The threshold above which we consider variables to be dependant.
Definition: iti.h:262
Learn a graphical representation of a function as a decision tree.
Definition: iti.h:62
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Safe iterators for the Set classDevelopers may consider using Set<x>::iterator_safe instead of SetIte...
Definition: set.h:811
~ITI()
Default destructor.
Definition: iti.h:105
<agrum/FMDP/learning/datastructure/incrementalGraphLearner>
HashTable< NodeId, bool > __staleTable
Hashtable indicating if given node has been modified (upon receiving new exemple or through a transpo...
Definition: iti.h:256
void updateGraph()
Updates the internal graph after a new observation has been added.
Definition: iti_tpl.h:143
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
void _insertSetOfVars(MultiDimFunctionGraph< double > *ret)
_insertSetOfVars
Definition: iti.h:244
Idx __nbTotalObservation
The total number of observation added to this tree.
Definition: iti.h:259
void _updateNodeWithObservation(const Observation *newObs, NodeId currentNodeId)
Will update internal graph&#39;s NodeDatabase of given node with the new observation. ...
Definition: iti_tpl.h:126
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:165
ITI(MultiDimFunctionGraph< double > *target, double attributeSelectionThreshold, Set< const DiscreteVariable * > attributeListe, const DiscreteVariable *learnedValue)
ITI constructor for functions describing the behaviour of one variable according to a set of other va...
Definition: iti_tpl.h:61
virtual void add(const DiscreteVariable &v)
Adds a new var to the variables of the multidimensional matrix.
void _removeNode(NodeId removedNodeId)
Removes a node from the internal graph.
Definition: iti_tpl.h:246
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
NodeId __insertTerminalNode(NodeId src)
Insert a terminal node in the target.
Definition: iti.h:208
void _chgNodeBoundVar(NodeId chgedNodeId, const DiscreteVariable *desiredVar)
Changes the associated variable of a node.
Definition: iti_tpl.h:229
Size Idx
Type for indexes.
Definition: types.h:53
void addObservation(const Observation *obs)
Inserts a new observation.
Definition: iti_tpl.h:112
Size NodeId
Type for node ids.
Definition: graphElements.h:98
<agrum/FMDP/learning/datastructure/nodeDatabase.h>
Definition: nodeDatabase.h:58