/**
* @file KCGPRegression.h
* @brief Gaussian Process Regression for Classification
* @author Erik Rodner
* @date 12/03/2009

*/
#ifndef KCGPREGRESSIONINCLUDE
#define KCGPREGRESSIONINCLUDE

#include "vislearning/classifier/classifierbase/KernelClassifier.h"
#include "vislearning/math/kernels/ParameterizedKernel.h"

#include "vislearning/regression/regressionbase/RegressionAlgorithmKernel.h"
#include "vislearning/regression/regressionbase/TeachWithInverseKernelMatrix.h"

#undef ROADWORKS
#define ROADWORKS fthrow(NICE::Exception, "Persistent interface not implemented!");

namespace OBJREC
{

/** Gaussian Process Regression for Classification */
class KCGPRegression : public KernelClassifier
{

  protected:
    RegressionAlgorithmKernel *regressionAlgorithm;
    NICE::Vector y;

  public:

    /** simple constructor */
    KCGPRegression ( const NICE::Config *conf, Kernel *kernel = NULL, const std::string & section = "KCGPRegression" );

    /** copy constructor */
    KCGPRegression ( const KCGPRegression & src );

    /** simple destructor */
    virtual ~KCGPRegression();

    /** teach the classifier with a kernel matrix and the corresponding class labels @param y ! */
    void teach ( KernelData *kernelData, const NICE::Vector & y );

    /** classify an example by using its kernel values with the training set,
     be careful with the order in @param kernelVector */
    virtual ClassificationResult classifyKernel ( const NICE::Vector & kernelVector, double kernelSelf ) const;

    /** clone this object */
    KCGPRegression *clone() const;

    void restore ( std::istream&, int )
    {
      ROADWORKS
    };
    void store ( std::ostream&, int ) const
    {
      ROADWORKS
    };
    void clear()
    {
      ROADWORKS
    };

    bool getOptimizeKernelParameters () const;
};


}

#undef ROADWORKS

#endif
