aGrUM  0.13.2
scoreAIC.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
31 #ifndef GUM_LEARNING_SCORE_AIC_H
32 #define GUM_LEARNING_SCORE_AIC_H
33 
34 #include <string>
35 
36 #include <agrum/agrum.h>
39 
40 namespace gum {
41 
42  namespace learning {
43 
44  /* =========================================================================
45  */
46  /* === SCORE AIC CLASS ===
47  */
48  /* =========================================================================
49  */
66  template < typename IdSetAlloc = std::allocator< Idx >,
67  typename CountAlloc = std::allocator< double > >
68  class ScoreAIC : public Score< IdSetAlloc, CountAlloc > {
69  public:
70  // ##########################################################################
72  // ##########################################################################
74 
76 
83  template < typename RowFilter >
84  ScoreAIC(const RowFilter& filter,
85  const std::vector< Size >& var_modalities,
87  Size min_range = 0,
88  Size max_range = std::numeric_limits< Size >::max());
89 
92 
95 
98 
100  virtual ~ScoreAIC();
101 
103 
104  // ##########################################################################
106  // ##########################################################################
108 
110  virtual double score(Idx nodeset_index) final;
111 
114 
132  virtual bool isAprioriCompatible() const final;
133 
136 
154  static bool isAprioriCompatible(const std::string& apriori_type,
155  double weight = 1.0f);
156 
159 
177  static bool
179 
181 
197  internalApriori() const noexcept final;
198 
200 
201  private:
204  };
205 
206  } /* namespace learning */
207 
208 } /* namespace gum */
209 
210 
211 extern template class gum::learning::ScoreAIC<>;
212 
213 
214 // always include the template implementation
216 
217 #endif /* GUM_LEARNING_SCORE_AIC_H */
unsigned long Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:50
The base class for all the scores used for learning (BIC, BDeu, etc)The class should be used as follo...
Definition: score.h:73
virtual ~ScoreAIC()
destructor
ScoreInternalNoApriori< IdSetAlloc, CountAlloc > __internal_apriori
the internal apriori of the score
Definition: scoreAIC.h:203
the base class for all apriori
Definition: apriori.h:45
virtual bool isAprioriCompatible() const final
indicates whether the apriori is compatible (meaningful) with the score
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
the class for computing AIC scores
the class for computing AIC scores
Definition: scoreAIC.h:68
ScoreAIC(const RowFilter &filter, const std::vector< Size > &var_modalities, Apriori< IdSetAlloc, CountAlloc > &apriori, Size min_range=0, Size max_range=std::numeric_limits< Size >::max())
default constructor
the base class for all the score&#39;s internal apriorisSome scores include an apriori.
the base class for all the scores used for learning (BIC, BDeu, etc)
the internal apriori for the scores without apriori (e.g., BD)Some scores include an apriori...
virtual ScoreAIC< IdSetAlloc, CountAlloc > * copyFactory() const
virtual copy factory
the internal apriori for the scores without apriori (e.g., BD)
unsigned long Idx
Type for indexes.
Definition: types.h:43
virtual const ScoreInternalApriori< IdSetAlloc, CountAlloc > & internalApriori() const noexceptfinal
returns the internal apriori of the score
virtual double score(Idx nodeset_index) final
returns the score corresponding to a given nodeset