Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

plLearnUnKLaplace.h

00001 /*==============================================================================
00002  * Product        : OpenPL 
00003  * File           : plLearnUnKLaplace.h
00004  * Author         : Manuel Yguel
00005  * Creation       : Mon Nov 10 08:52:09 2003
00006  *
00007  *==============================================================================
00008  *     (c) Copyright 2003, Centre National de la Recherche Scientifique,
00009  *                              all rights reserved
00010  *==============================================================================
00011  *
00012  *------------------------- Description ----------------------------------------
00013  *   Learning n dimensionnal Laplaces with UNKNOWN variables definition 
00014  *  sets.
00015  *   
00016  *------------------------------------------------------------------------------
00017  */
00018 
00019 
00020 #ifndef __plLearnUnKLaplace_h__
00021 #define __plLearnUnKLaplace_h__
00022 
00023 
00024 #include <plLearnUnKHistogram.h>
00025 
00026 /* plUnKLaplaceParameters class */
00027 class plUnKLaplaceParameters : public plUnKHistogramParameters
00028 {
00029 protected :
00030   double _lidstone;
00031 
00032 public :
00033   plUnKLaplaceParameters( const plVariablesConjunction& var, 
00034               const plValues& min, const plValues& max, 
00035               double lidstone = 1.0 )
00036     : plUnKHistogramParameters( var, min, max ), _lidstone( lidstone ) {}
00037   
00038   plUnKLaplaceParameters( const plVariablesConjunction& var, 
00039               const vector<plValues>& selected_values, 
00040               double lidstone = 1.0  )
00041     : plUnKHistogramParameters( var, selected_values ), _lidstone( lidstone ) {}
00042 
00043   inline double getLidstone() const
00044   {
00045     return _lidstone;
00046   }
00047 };
00048 
00049 
00050 //==============================================================================
00053 class plLearnUnKLaplace : public plLearnUnKHistogram
00054 {
00055 
00056  public:
00057   /*CONSTRUCTORS*/
00059   plLearnUnKLaplace(const plLearnUnKLaplace & plLUKH);
00060 
00061   plLearnUnKLaplace( const plVariablesConjunction &vars );
00062 
00067   plLearnUnKLaplace( const plVariablesConjunction &vars,
00068                map< plDataValues, plLearnFrequence >*const initial,
00069                bool copie=false );
00070 
00072   plLearnUnKLaplace( const plVariablesConjunction &vars,
00073                const map< plDataValues, plLearnFrequence >& initial );
00074 
00075 
00076   /*********************/
00077 
00078   virtual ~plLearnUnKLaplace(){};
00079 
00086   void get_plProbValue( map< plDataValues,plProbValue>& prob_map_ref ) 
00087     const;
00088 
00089 
00095   void get_plProbValue( map< plDataValues,plProbValue>& prob_map_ref, 
00096             plLearnClassesTotal cardinality ) 
00097     const;
00098 
00107   void get_plProbValue( map< plDataValues,plProbValue>& prob_map_ref, 
00108             plLearnClassesTotal cardinality, double alpha )
00109     const;
00110 
00111 
00115   void select_plProbValue(vector<plProbValue>& prob_ref, 
00116               const vector<plValues>& selected_values ) const;
00117 
00121   plProbValue *
00122     select_plProbValue( const vector<plValues>& selected_values ) const;
00123   
00124 
00128   void select_plProbValue(vector<plProbValue>& prob_ref, 
00129               const vector<plValues>& selected_values,
00130               double alpha ) const;
00131 
00135   plProbValue *
00136     select_plProbValue( const vector<plValues>& selected_values, 
00137             double alpha ) const;
00138 
00139 
00140 
00141 
00142 
00147   void get_plProbValue(vector<plProbValue>& prob_ref, 
00148                const plValues& min, 
00149                const plValues& max) const;
00150 
00154   void get_plProbValue(vector<plProbValue>& prob_ref, 
00155                const plValues& min, 
00156                const plValues& max, 
00157                double alpha) const;
00158   
00162   plProbValue *get_plProbValue(const plValues& min, 
00163                    const plValues& max) const;
00164 
00165 
00170   plProbValue *get_plProbValue(const plValues& min, 
00171                    const plValues& max,
00172                    double alpha) const;
00173                                
00175   plKernel get_distribution( const void *parameters = NULL ) const
00176   {
00177     if(!parameters) return plKernel();
00178   
00179     vector<plProbValue> prob;
00180     plUnKLaplaceParameters *p =  (plUnKLaplaceParameters *)parameters;
00181 
00182     switch( p->getType() )
00183       {
00184       case BOUNDARY :get_plProbValue( prob, p->getMin(), p->getMax(), p->getLidstone() );break;
00185       case SELECT :select_plProbValue( prob, *(p->getSelectedValues()), p->getLidstone() );break;
00186       default :printf( "Unknown parameter type for get_distribution of plLearnUnKHistogram\n" );
00187         abort();
00188         exit(-1);
00189       }
00190 
00191     return plProbTable( p->getVar(), prob, false );
00192   }
00193 
00194 };
00195 
00196 
00197 
00198 #endif

Generated on Fri Apr 1 10:58:14 2005 for ProBT by  doxygen 1.4.1