#ifndef NUMMODEL_HH #define NUMMODEL_HH //////////////////////////////////////////////////////////////////////////// //! author="Robert Crida" //! lib=NumModel //! date="2/2/1998" //! userlevel=Normal //! example=testNumModel.cc //! file="amma/PatternRec/FuncTools/Model/BaseBody/NumModel.hh" //! docentry="Numerical Methods.Multidimensional Models" //! rcsid="$Id: NumModel.hh,v 1.8 2000/10/04 13:01:12 ees1cg Exp $" #include "amma/Num/NumFunc.hh" #include "amma/Num/NumModelB.hh" // -------------------------------------------------------------------------- // ********** NumModelC *************************************************** // -------------------------------------------------------------------------- //: Handle class for numerical models of the form Y=f(X). // // Handle class for numerical models of the form Y=f(X) which are derived // from NumFuncC so Y and X are vectors. The behaviour that is added over // NumFuncC is that the relationship can be learnt using the Fit member // function. class NumModelC: public NumFuncC { public: NumModelC (); //: Default constructor NumModelC (istream &in); //: Constructs from stream NumModelC (const NumModelC &oth); //: Copy constructor NumModelC (NumModelBC &oth); //: Constructs from base class protected: inline NumModelBC & Body() { return static_cast(DPEntityC::Body()); } //: Access body. inline const NumModelBC & Body() const { return static_cast(DPEntityC::Body()); } //: Access body. public: NumModelC Copy () const; //: Makes a deep copy inline void Initialise (const NumVVDataSetC &train) { Body().Initialise(train); } //: Initialises model to an untrained state //!param: train - data set provided to give model example of data // Must be overloaded in derived class that train incrementally and provides // a mechanism for restarting training from scratch. Default behaviour is // to do nothing. inline void Fit (const NumVVDataSetC &train) { Body().Fit(train); } //: Used to train the model using set of input/output vectors // It should be assumed that the same sort of data will be provided for // fitting as was presented to the Initialise function previously. ie same // preprocessing should be applied as was appropriate for the initialisation // sample set. }; //: Provides >> and << operators to streams NUM_IO_OPERATORS(NumModelC); /////////////////////////////////////////// #endif