class NaiveBayes extends AbstractClassifier<Data,String> {

	@Override
	public String predict( Data item ){
		Map<String,Double> probs = this.vote( item );
		Double max = 0.0d;
		String maxClass = null;
		Double confidence = 0.0d;

		for( String clazz : probs.keySet() ){
			Double likelihood = probs.get( clazz );
			log.debug( "probability for {} is {}", clazz, likelihood );
			//item.put( LearnerUtils.hide( "pred(" + clazz + ")" ), likelihood );
			if( maxClass == null || likelihood > max ){
				maxClass = clazz;
				if( max != null )
					confidence = 1.0d - Math.abs( likelihood - max );
				else
					confidence = 1.0d;
				max = likelihood;
			}
		}
		
		log.info( "Predicting class {}, label is: {}, confidence-gap: " + confidence + " wop=" + wop, maxClass, item.get( labelAttribute ) );
		return maxClass;
	}

	public  NaiveBayes();
	public  NaiveBayes( String labelAttribute );

}