Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

learningenv.h

Go to the documentation of this file.
00001 
00025 #ifndef __NEURALENV__
00026 #define __NEURALENV__
00027 
00028 #include <nhp/gaenvrnmt.h>
00029 #include <inanna/patternset.h>
00030 
00031 // Externals
00032 class PatternSet;
00033 template<class K, class V> class Map;
00034 //typedef Map<String,String> StringMap;
00035 
00045 class LearningEAEnv : public EAEnvironment {
00046     decl_dynamic (LearningEAEnv);
00047   public:
00048 
00049                         LearningEAEnv   ();
00050                         LearningEAEnv   (const PatternSet& trainset,
00051                                          const PatternSet& evaluationset,
00052                                          const PatternSet& reportset,
00053                                          StringMap& params);
00054 
00063     void                setProblemType  (int pt) {mProblemType=pt;}
00064 
00072     enum problemtypes {CLASSIFICATION=0, CLASSIFICATION2, APPROXIMATION};
00073     
00074     // Implementations
00075 
00076     virtual void        addFeaturesTo   (Genome& genome) const;
00077 
00079     virtual void        cycle_report    (OStream& log, OStream& out);
00080 
00082     virtual double      evaluateg       (const Individual& genome);
00083 
00085     virtual DataOStream& operator>>		(DataOStream& out) const;
00086 
00088     virtual void        check           () const;
00089 
00090   protected:
00091 
00095     void permutate ();
00096 
00098     void                splitTrainData  ();
00099     Trainer*            createTrainer   () const;
00100     
00101   private:
00102     PatternSet          mTrainData;     // Full training data
00103     PatternSet          mTrainSet;      // Training part extracted from mTrainData
00104     PatternSet          mEvaluationSet; // Evaluation part extracted from mTrainData
00105     const PatternSource& mReportSet;    // Set for "final" testing. Should not even be here.
00106     StringMap&          mParams;        // Stored application-level parameters, hmmmmm....
00107     int                 mProblemType;   // classif./2-classif./approx.
00108     double              mEvalPart;      // Part of training data used for evaluation
00109     double              mTermPart;      // Part of training data used for termination
00110     int                 mMaxTrainCycles;// Max number of cycles to train
00111     int                 mReportCycles;  // Max number of cycles to train for report set
00112     int                 mValidInterval; // Training termination check interval
00113     String              mTermMethod;    // Termination method name (default=UP2)
00114     bool                mPermutate;     // Permutate training data during evolution
00115 };
00116 
00117 #endif
00118 

Generated on Thu Feb 10 20:21:26 2005 for Annalee by doxygen1.2.18