/**
* @file VCCrossGeneralization.h
* @brief Combination of Classifiers
* @author Erik Rodner
* @date 12/05/2007

*/
#ifndef VCCrossGeneralizationINCLUDE
#define VCCrossGeneralizationINCLUDE

#ifdef NICE_USELIB_ICE

#include "VCLearnFromSC.h"

#ifdef NICE_USELIB_ICE
#include "VCSimpleGaussian.h"
#endif
#include "VCNearestNeighbour.h"
#include "core/basics/Config.h"


namespace OBJREC
{

/** Combination of Classifiers */
class VCCrossGeneralization : public VCLearnFromSC
{

  protected:
    bool useVotingNormalization;

    VCSimpleGaussian gauss;

    VCNearestNeighbour nnclassifier;

    bool simpleGaussianFinished;

    void normalizeVotings ( NICE::Vector & v ) const;

  public:

    /** simple constructor */
    VCCrossGeneralization ( const NICE::Config *conf );

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

    /** classify using simple vector */

    virtual ClassificationResult classify ( const NICE::Vector & x ) const;

    virtual void preTeach ( const LabeledSetVector & teachSet );

    virtual void teach ( const LabeledSetVector & teachSet );

    virtual void finishTeaching();

    void restore ( std::istream & is, int format = 0 );

    void store ( std::ostream & is, int format = 0 ) const;

    void clear ();

};


} // namespace

#endif

#endif
