123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #ifndef KERNELCLASSIFIERINCLUDE
- #define KERNELCLASSIFIERINCLUDE
- #include "vislearning/math/kernels/Kernel.h"
- #include "vislearning/math/kernels/KernelData.h"
- #include "core/vector/VVector.h"
- #include "vislearning/cbaselib/ClassificationResult.h"
- #include "vislearning/cbaselib/LabeledSet.h"
- #include "vislearning/classifier/classifierbase/VecClassifier.h"
- namespace OBJREC
- {
- class KernelClassifier : public VecClassifier
- {
- public:
- enum
- {
- KERNELCLASSIFIER_NORMALIZATION_EUCLIDEAN = 0,
- KERNELCLASSIFIER_NORMALIZATION_NONE
- };
- protected:
-
- Kernel *kernelFunction;
-
- NICE::VVector vecSet;
-
- NICE::Vector vecSetLabels;
-
- int normalizationType;
-
- NICE::Config conf;
- public:
-
- KernelClassifier() {};
-
- KernelClassifier ( const NICE::Config *conf, Kernel *kernelFunction = NULL, int normalizationType = KERNELCLASSIFIER_NORMALIZATION_EUCLIDEAN );
-
- KernelClassifier ( const KernelClassifier & src );
-
- virtual ~KernelClassifier();
-
-
- virtual void teach ( KernelData *kernelData, const NICE::Vector & y ) = 0;
-
- virtual ClassificationResult classifyKernel ( const NICE::Vector & kernelVector, double kernelSelf ) const = 0;
-
-
- ClassificationResult classify ( const NICE::Vector & x ) const;
-
- virtual void teach ( const LabeledSetVector & teachSet );
-
- void finishTeaching() {};
-
- KernelClassifier *clone ( void ) const
- {
- fthrow ( NICE::Exception, "clone() not yet implemented." );
- }
- Kernel *getKernelFunction () const
- {
- return kernelFunction;
- };
- virtual void restore ( std::istream&, int );
- virtual void store ( std::ostream&, int ) const;
- };
- }
- #endif
|