/** 
* @file VCNearestClassMean.h
* @brief Nearest Class Mean Classifier (Naive Bayes with identity covariance matrix for all classes) -> code is based on VCSimpleGaussian and VCNearestNeighbor
* @author Erik Rodner + Mi.Ke
* @date 12/05/2007

*/

#ifdef NICE_USELIB_ICE

#ifndef VCNEARESTCLASSMEANINCLUDE
#define VCNEARESTCLASSMEANINCLUDE

#include "vislearning/classifier/classifierbase/VecClassifier.h"
#include <core/vector/Distance.h>

#include <image_nonvis.h>

namespace OBJREC {

/** Simple Gaussian Classifier */
class VCNearestClassMean : public VecClassifier
{
    public:
	std::vector<NICE::Vector> means;
	std::vector<int> classNo;
	NICE::VectorDistance<double> *distancefunc;
	std::map<int, ice::Statistics *> statistics;

    public:
  
	/** simple constructor */
	VCNearestClassMean( const NICE::Config *conf, NICE::VectorDistance<double> *distancefunc = NULL );
      
	/** simple destructor */
	virtual ~VCNearestClassMean();
 
	/** classify using simple vector */
	ClassificationResult classify ( const NICE::Vector & x ) const;

	/** classify using a simple vector */
	void teach ( const LabeledSetVector & teachSet );
	
	void finishTeaching();

	void clear ();

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

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

};


} // namespace

#endif //VCNEARESTCLASSMEANINCLUDE
#endif //NICE_USELIB_ICE