test_class.declarator: p = SQL2ParserTest.createTestSQL2Parser()
test_class.modifier: private static final
test_class.original_string: private static final SQL2Parser p = SQL2ParserTest.createTestSQL2Parser();
test_class.type: SQL2Parser
test_class.var_name: p
test_class.file: oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/search/util/LMSEstimatorTest.java
test_class.identifier: LMSEstimatorTest
test_case.body: @Test
      public void testUpdate() throws Exception {
          LMSEstimator lmsEstimator = new LMSEstimator();
          Filter filter = mock(Filter.class);
          long numDocs = 100L;
          lmsEstimator.update(filter, numDocs);
      }
test_case.class_method_signature: LMSEstimatorTest.testUpdate()
test_case.full_signature: @Test public void testUpdate()
test_case.identifier: testUpdate
test_case.invocations: mock update
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdate()
focal_class.declarator: DEFAULT_ALPHA = 0.03
focal_class.modifier: private static final
focal_class.original_string: private static final double DEFAULT_ALPHA = 0.03;
focal_class.type: double
focal_class.var_name: DEFAULT_ALPHA
focal_class.declarator: DEFAULT_THRESHOLD = 5
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_THRESHOLD = 5;
focal_class.type: int
focal_class.var_name: DEFAULT_THRESHOLD
focal_class.declarator: weights
focal_class.modifier: private
focal_class.original_string: private double[] weights;
focal_class.type: double[]
focal_class.var_name: weights
focal_class.declarator: alpha
focal_class.modifier: private final
focal_class.original_string: private final double alpha;
focal_class.type: double
focal_class.var_name: alpha
focal_class.declarator: threshold
focal_class.modifier: private final
focal_class.original_string: private final long threshold;
focal_class.type: long
focal_class.var_name: threshold
focal_class.file: oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/util/LMSEstimator.java
focal_class.identifier: LMSEstimator
focal_class.class_method_signature: LMSEstimator.LMSEstimator(double alpha, double[] weights, long threshold)
focal_class.full_signature: private  LMSEstimator(double alpha, double[] weights, long threshold)
focal_class.identifier: LMSEstimator
focal_class.modifiers: private
focal_class.parameters: (double alpha, double[] weights, long threshold)
focal_class.signature:  LMSEstimator(double alpha, double[] weights, long threshold)
focal_class.class_method_signature: LMSEstimator.LMSEstimator()
focal_class.full_signature: public  LMSEstimator()
focal_class.identifier: LMSEstimator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  LMSEstimator()
focal_class.class_method_signature: LMSEstimator.update(Filter filter, long numFound)
focal_class.full_signature: public synchronized void update(Filter filter, long numFound)
focal_class.identifier: update
focal_class.modifiers: public synchronized
focal_class.parameters: (Filter filter, long numFound)
focal_class.return: void
focal_class.signature: void update(Filter filter, long numFound)
focal_class.class_method_signature: LMSEstimator.estimate(Filter filter)
focal_class.full_signature: public long estimate(Filter filter)
focal_class.identifier: estimate
focal_class.modifiers: public
focal_class.parameters: (Filter filter)
focal_class.return: long
focal_class.signature: long estimate(Filter filter)
focal_class.class_method_signature: LMSEstimator.getInput(Filter filter, int i)
focal_class.full_signature: private long getInput(Filter filter, int i)
focal_class.identifier: getInput
focal_class.modifiers: private
focal_class.parameters: (Filter filter, int i)
focal_class.return: long
focal_class.signature: long getInput(Filter filter, int i)
focal_method.body: public synchronized void update(Filter filter, long numFound) {
          double[] updatedWeights = new double[weights.length];
  
          // least mean square cost
          long estimate = estimate(filter);
          long residual = numFound - estimate;
          double delta = Math.pow(residual, 2);
  
          if (Math.abs(delta) > threshold) {
              for (int i = 0; i < updatedWeights.length; i++) {
                  updatedWeights[i] = weights[i] + alpha * residual * getInput(filter, i);
              }
              // weights updated
              weights = Arrays.copyOf(updatedWeights, 5);
          }
      }
focal_method.class_method_signature: LMSEstimator.update(Filter filter, long numFound)
focal_method.full_signature: public synchronized void update(Filter filter, long numFound)
focal_method.identifier: update
focal_method.invocations: estimate pow abs getInput copyOf
focal_method.modifiers: public synchronized
focal_method.parameters: (Filter filter, long numFound)
focal_method.return: void
focal_method.signature: void update(Filter filter, long numFound)