test_class.declarator: log = LoggerFactory.getLogger( NaiveBayesTest.class )
test_class.modifier: static
test_class.original_string: static Logger log = LoggerFactory.getLogger( NaiveBayesTest.class );
test_class.type: Logger
test_class.var_name: log
test_class.file: ml/streaminer/src/test/java/org/streaminer/stream/classifier/bayes/NaiveBayesTest.java
test_class.identifier: NaiveBayesTest
test_case.body: @Test
  	public void testPredict() {
  		//fail("Not yet implemented");
  	}
test_case.class_method_signature: NaiveBayesTest.testPredict()
test_case.full_signature: @Test public void testPredict()
test_case.identifier: testPredict
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPredict()
focal_class.declarator: serialVersionUID = 1095437834368310484L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 1095437834368310484L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: log = LoggerFactory.getLogger( NaiveBayes.class )
focal_class.modifier: static
focal_class.original_string: static Logger log = LoggerFactory.getLogger( NaiveBayes.class );
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: labelAttribute = null
focal_class.original_string: String labelAttribute = null;
focal_class.type: String
focal_class.var_name: labelAttribute
focal_class.declarator: laplaceCorrection = 0.0001
focal_class.original_string: Double laplaceCorrection = 0.0001;
focal_class.type: Double
focal_class.var_name: laplaceCorrection
focal_class.declarator: confidenceGap = new Double( 0.0d )
focal_class.original_string: Double confidenceGap = new Double( 0.0d );
focal_class.type: Double
focal_class.var_name: confidenceGap
focal_class.declarator: wop = false
focal_class.original_string: Boolean wop = false;
focal_class.type: Boolean
focal_class.var_name: wop
focal_class.declarator: classDistribution = null
focal_class.original_string: Distribution<String> classDistribution = null;
focal_class.type: Distribution<String>
focal_class.var_name: classDistribution
focal_class.declarator: distributions = new HashMap<String,Distribution<?>>()
focal_class.original_string: Map<String,Distribution<?>> distributions = new HashMap<String,Distribution<?>>();
focal_class.type: Map<String,Distribution<?>>
focal_class.var_name: distributions
focal_class.file: ml/streaminer/src/main/java/org/streaminer/stream/classifier/bayes/NaiveBayes.java
focal_class.identifier: NaiveBayes
focal_class.class_method_signature: NaiveBayes.NaiveBayes()
focal_class.full_signature: public  NaiveBayes()
focal_class.identifier: NaiveBayes
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  NaiveBayes()
focal_class.class_method_signature: NaiveBayes.NaiveBayes( String labelAttribute )
focal_class.full_signature: public  NaiveBayes( String labelAttribute )
focal_class.identifier: NaiveBayes
focal_class.modifiers: public
focal_class.parameters: ( String labelAttribute )
focal_class.signature:  NaiveBayes( String labelAttribute )
focal_class.class_method_signature: NaiveBayes.getLabelAttribute()
focal_class.full_signature: public String getLabelAttribute()
focal_class.identifier: getLabelAttribute
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getLabelAttribute()
focal_class.class_method_signature: NaiveBayes.setLabelAttribute(String labelAttribute)
focal_class.full_signature: public void setLabelAttribute(String labelAttribute)
focal_class.identifier: setLabelAttribute
focal_class.modifiers: public
focal_class.parameters: (String labelAttribute)
focal_class.return: void
focal_class.signature: void setLabelAttribute(String labelAttribute)
focal_class.class_method_signature: NaiveBayes.getLaplaceCorrection()
focal_class.full_signature: public Double getLaplaceCorrection()
focal_class.identifier: getLaplaceCorrection
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Double
focal_class.signature: Double getLaplaceCorrection()
focal_class.class_method_signature: NaiveBayes.setLaplaceCorrection(Double laplaceCorrection)
focal_class.full_signature: public void setLaplaceCorrection(Double laplaceCorrection)
focal_class.identifier: setLaplaceCorrection
focal_class.modifiers: public
focal_class.parameters: (Double laplaceCorrection)
focal_class.return: void
focal_class.signature: void setLaplaceCorrection(Double laplaceCorrection)
focal_class.class_method_signature: NaiveBayes.getConfidenceGap()
focal_class.full_signature: public Double getConfidenceGap()
focal_class.identifier: getConfidenceGap
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Double
focal_class.signature: Double getConfidenceGap()
focal_class.class_method_signature: NaiveBayes.setConfidenceGap(Double confidenceGap)
focal_class.full_signature: public void setConfidenceGap(Double confidenceGap)
focal_class.identifier: setConfidenceGap
focal_class.modifiers: public
focal_class.parameters: (Double confidenceGap)
focal_class.return: void
focal_class.signature: void setConfidenceGap(Double confidenceGap)
focal_class.class_method_signature: NaiveBayes.getWop()
focal_class.full_signature: public Boolean getWop()
focal_class.identifier: getWop
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Boolean
focal_class.signature: Boolean getWop()
focal_class.class_method_signature: NaiveBayes.setWop(Boolean wop)
focal_class.full_signature: public void setWop(Boolean wop)
focal_class.identifier: setWop
focal_class.modifiers: public
focal_class.parameters: (Boolean wop)
focal_class.return: void
focal_class.signature: void setWop(Boolean wop)
focal_class.class_method_signature: NaiveBayes.vote(Data item)
focal_class.full_signature: @SuppressWarnings("unchecked") public Map<String,Double> vote(Data item)
focal_class.identifier: vote
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (Data item)
focal_class.return: Map<String,Double>
focal_class.signature: Map<String,Double> vote(Data item)
focal_class.class_method_signature: NaiveBayes.predict( Data item )
focal_class.full_signature: @Override public String predict( Data item )
focal_class.identifier: predict
focal_class.modifiers: @Override public
focal_class.parameters: ( Data item )
focal_class.return: String
focal_class.signature: String predict( Data item )
focal_class.class_method_signature: NaiveBayes.getNominalCondition( String attribute, Data item )
focal_class.full_signature: public String getNominalCondition( String attribute, Data item )
focal_class.identifier: getNominalCondition
focal_class.modifiers: public
focal_class.parameters: ( String attribute, Data item )
focal_class.return: String
focal_class.signature: String getNominalCondition( String attribute, Data item )
focal_class.class_method_signature: NaiveBayes.learn(Data item)
focal_class.full_signature: @SuppressWarnings("unchecked") @Override public void learn(Data item)
focal_class.identifier: learn
focal_class.modifiers: @SuppressWarnings("unchecked") @Override public
focal_class.parameters: (Data item)
focal_class.return: void
focal_class.signature: void learn(Data item)
focal_class.class_method_signature: NaiveBayes.getClassDistribution()
focal_class.full_signature: public Distribution<String> getClassDistribution()
focal_class.identifier: getClassDistribution
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Distribution<String>
focal_class.signature: Distribution<String> getClassDistribution()
focal_class.class_method_signature: NaiveBayes.getNumericalDistributions()
focal_class.full_signature: @SuppressWarnings("unchecked") public List<Distribution<Double>> getNumericalDistributions()
focal_class.identifier: getNumericalDistributions
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: ()
focal_class.return: List<Distribution<Double>>
focal_class.signature: List<Distribution<Double>> getNumericalDistributions()
focal_class.class_method_signature: NaiveBayes.createNominalDistribution()
focal_class.full_signature: public Distribution<String> createNominalDistribution()
focal_class.identifier: createNominalDistribution
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Distribution<String>
focal_class.signature: Distribution<String> createNominalDistribution()
focal_class.class_method_signature: NaiveBayes.createNumericalDistribution()
focal_class.full_signature: public Distribution<Double> createNumericalDistribution()
focal_class.identifier: createNumericalDistribution
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Distribution<Double>
focal_class.signature: Distribution<Double> createNumericalDistribution()
focal_class.superclass: extends AbstractClassifier<Data,String>
focal_method.body: @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;
  	}
focal_method.class_method_signature: NaiveBayes.predict( Data item )
focal_method.full_signature: @Override public String predict( Data item )
focal_method.identifier: predict
focal_method.invocations: vote keySet get debug abs info get
focal_method.modifiers: @Override public
focal_method.parameters: ( Data item )
focal_method.return: String
focal_method.signature: String predict( Data item )