test_class.file: storm/trident-ml/src/test/java/com/github/pmerienne/trident/ml/stats/AdaptiveStreamFeatureStatisticsTest.java
test_class.identifier: AdaptiveStreamFeatureStatisticsTest
test_case.body: @Test
  	public void testUpdate() {
  		// Given
  		Random random = new Random();
  		double expectedMean = 4.0;
  		double stdDev = 3.0;
  		int size = 10000;
  
  		double[] features = new double[size];
  		for (int i = 0; i < size; i++) {
  			features[i] = expectedMean + random.nextGaussian() * stdDev;
  		}
  
  		// When
  		AdaptiveStreamFeatureStatistics statistics = new AdaptiveStreamFeatureStatistics(1000);
  		for (int i = 0; i < size; i++) {
  			statistics.update(features[i]);
  		}
  
  		// Then
  		assertEquals(expectedMean, statistics.getMean(), 0.3);
  		assertEquals(stdDev, statistics.getStdDev(), 0.3);
  	}
test_case.class_method_signature: AdaptiveStreamFeatureStatisticsTest.testUpdate()
test_case.full_signature: @Test public void testUpdate()
test_case.identifier: testUpdate
test_case.invocations: nextGaussian update assertEquals getMean assertEquals getStdDev
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdate()
focal_class.declarator: serialVersionUID = 6267199325838362436L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 6267199325838362436L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: maxSize = 1000
focal_class.modifier: private
focal_class.original_string: private long maxSize = 1000;
focal_class.type: long
focal_class.var_name: maxSize
focal_class.declarator: features = new LinkedList<Double>()
focal_class.modifier: private
focal_class.original_string: private LinkedList<Double> features = new LinkedList<Double>();
focal_class.type: LinkedList<Double>
focal_class.var_name: features
focal_class.declarator: count = 0L
focal_class.modifier: private
focal_class.original_string: private long count = 0L;
focal_class.type: long
focal_class.var_name: count
focal_class.declarator: sum = 0L
focal_class.modifier: private
focal_class.original_string: private double sum = 0L;
focal_class.type: double
focal_class.var_name: sum
focal_class.declarator: squaresSum = 0.0
focal_class.modifier: private
focal_class.original_string: private double squaresSum = 0.0;
focal_class.type: double
focal_class.var_name: squaresSum
focal_class.file: storm/trident-ml/src/main/java/com/github/pmerienne/trident/ml/stats/AdaptiveStreamFeatureStatistics.java
focal_class.identifier: AdaptiveStreamFeatureStatistics
focal_class.interfaces: implements StreamFeatureStatistics, Serializable
focal_class.class_method_signature: AdaptiveStreamFeatureStatistics.AdaptiveStreamFeatureStatistics()
focal_class.full_signature: public  AdaptiveStreamFeatureStatistics()
focal_class.identifier: AdaptiveStreamFeatureStatistics
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  AdaptiveStreamFeatureStatistics()
focal_class.class_method_signature: AdaptiveStreamFeatureStatistics.AdaptiveStreamFeatureStatistics(long maxSize)
focal_class.full_signature: public  AdaptiveStreamFeatureStatistics(long maxSize)
focal_class.identifier: AdaptiveStreamFeatureStatistics
focal_class.modifiers: public
focal_class.parameters: (long maxSize)
focal_class.signature:  AdaptiveStreamFeatureStatistics(long maxSize)
focal_class.class_method_signature: AdaptiveStreamFeatureStatistics.update(double feature)
focal_class.full_signature: public void update(double feature)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (double feature)
focal_class.return: void
focal_class.signature: void update(double feature)
focal_class.class_method_signature: AdaptiveStreamFeatureStatistics.getCount()
focal_class.full_signature: @Override public Long getCount()
focal_class.identifier: getCount
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Long
focal_class.signature: Long getCount()
focal_class.class_method_signature: AdaptiveStreamFeatureStatistics.getMean()
focal_class.full_signature: @Override public Double getMean()
focal_class.identifier: getMean
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Double
focal_class.signature: Double getMean()
focal_class.class_method_signature: AdaptiveStreamFeatureStatistics.getVariance()
focal_class.full_signature: @Override public Double getVariance()
focal_class.identifier: getVariance
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Double
focal_class.signature: Double getVariance()
focal_class.class_method_signature: AdaptiveStreamFeatureStatistics.getStdDev()
focal_class.full_signature: @Override public Double getStdDev()
focal_class.identifier: getStdDev
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Double
focal_class.signature: Double getStdDev()
focal_class.class_method_signature: AdaptiveStreamFeatureStatistics.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public void update(double feature) {
  		this.count++;
  		this.features.add(feature);
  		this.sum += feature;
  		this.squaresSum += Math.pow(feature, 2);
  
  		if (this.features.size() > maxSize) {
  			double first = this.features.removeFirst();
  			this.sum -= first;
  			this.squaresSum -= Math.pow(first, 2);
  		}
  	}
focal_method.class_method_signature: AdaptiveStreamFeatureStatistics.update(double feature)
focal_method.full_signature: public void update(double feature)
focal_method.identifier: update
focal_method.invocations: add pow size removeFirst pow
focal_method.modifiers: public
focal_method.parameters: (double feature)
focal_method.return: void
focal_method.signature: void update(double feature)