1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #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(Exception, "clone() not yet implemented.");
- }
- Kernel *getKernelFunction () const { return kernelFunction; };
-
- virtual void restore(std::istream&, int);
- virtual void store(std::ostream&, int) const;
- };
- }
- #endif
|