aGrUM  0.13.3
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 
116  virtual std::string isAprioriCompatible() const final;
117 
120 
122  static std::string isAprioriCompatible(const std::string& apriori_type,
123  double weight = 1.0f);
124 
127 
128  static std::string
130 
132 
148  internalApriori() const noexcept final;
149 
151 
152  private:
155  };
156 
157  } /* namespace learning */
158 
159 } /* namespace gum */
160 
161 
162 extern template class gum::learning::ScoreAIC<>;
163 
164 
165 // always include the template implementation
167 
168 #endif /* GUM_LEARNING_SCORE_AIC_H */
virtual const ScoreInternalApriori< IdSetAlloc, CountAlloc > & internalApriori() const noexcept final
returns the internal apriori of the score
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:154
the base class for all apriori
Definition: apriori.h:45
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
virtual ScoreAIC< IdSetAlloc, CountAlloc > * copyFactory() const
virtual copy factory
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...
the internal apriori for the scores without apriori (e.g., BD)
unsigned long Idx
Type for indexes.
Definition: types.h:43
virtual std::string isAprioriCompatible() const final
indicates whether the apriori is compatible (meaningful) with the score
virtual double score(Idx nodeset_index) final
returns the score corresponding to a given nodeset