123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- #ifndef _NICE_OBJREC_KCNULLSPACEINCLUDE
- #define _NICE_OBJREC_KCNULLSPACEINCLUDE
- #include "vislearning/math/mathbase/FullVector.h"
- #include "vislearning/classifier/classifierbase/KernelClassifier.h"
- #include <vector>
- #include "core/vector/VVector.h"
- #include "core/vector/Eigen.h"
- namespace OBJREC
- {
- class KCNullSpace : public KernelClassifier
- {
- protected:
-
- bool verbose;
-
- NICE::Matrix eigenBasis;
-
-
- std::map<int, int> trainingSetStatistic;
-
-
- NICE::Matrix nullProjectionDirections;
-
-
- std::map<int, NICE::Vector> targetPoints;
-
-
- int dimNullSpace;
-
-
- bool oneClassSetting;
-
-
- void computeTrainingSetStatistic(const NICE::Vector & y);
-
-
- void computeNullProjectionDirections(const KernelData *kernelData, const NICE::Vector & y);
-
-
- void computeTargetPoints(const KernelData *kernelData, const NICE::Vector & y);
-
-
- void computeBasisUsingKernelPCA(const KernelData *kernelData);
-
-
- void centerKernelMatrix(NICE::Matrix & kernelMatrix);
-
- public:
-
-
- KCNullSpace() {};
-
- KCNullSpace ( const NICE::Config *conf, Kernel *kernelFunction = NULL, const std::string & section = "KCNullSpace" );
-
- KCNullSpace ( const KCNullSpace &vcova );
-
- virtual ~KCNullSpace();
-
- void teach ( KernelData *kernelData, const NICE::Vector & y );
- void teach ( KernelData *kernelData, const std::vector<double> & y );
-
- ClassificationResult classifyKernel ( const NICE::Vector & kernelVector, double kernelSelf ) const;
-
-
- ClassificationResult noveltyDetection ( const NICE::Vector & kernelVector, double kernelSelf ) const;
-
-
- std::map<int,int> * getTrainingSetStatistic();
-
-
- NICE::Matrix getNullProjectionDirections();
-
- std::map<int, NICE::Vector> * getTargetPoints();
-
-
- bool isOneClass();
-
-
- int getNullSpaceDimension();
-
- void restore ( std::istream&, int );
- void store ( std::ostream&, int ) const;
- void clear();
-
- virtual KCNullSpace *clone ( void ) const;
-
- };
- }
- #endif
|