test_class.declarator: log = LoggerFactory.getLogger(KalmanScalarFilterTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger log = LoggerFactory.getLogger(KalmanScalarFilterTest.class);
test_class.type: Logger
test_class.var_name: log
test_class.file: contrib/src/test/java/macrobase/analysis/stats/kalmanfilter/KalmanScalarFilterTest.java
test_class.identifier: KalmanScalarFilterTest
test_case.body: @Test
      public void reduceToVectorKalmanFilterTest() throws Exception {
          MacroBaseConf conf = new MacroBaseConf()
                  .set(MacroBaseConf.RANDOM_SEED, 4)
                  .set(MacroBaseConf.DATA_LOADER_TYPE, "CSV_LOADER")
                  .set(MacroBaseConf.CSV_COMPRESSION, CSVIngester.Compression.GZIP)
                  .set(MacroBaseConf.CSV_INPUT_FILE, "src/test/resources/data/2gaussians-500points.csv.gz")
                  .set(MacroBaseConf.METRICS, "XX, YY")
                  .set(MacroBaseConf.ATTRIBUTES, "");
          List<Datum> data = Drainer.drainIngest(conf);
          assertEquals(500, data.size());
  
          double qSacle = 1e-6;
  
          KalmanVectorFilter vf = new KalmanVectorFilter(new ArrayRealVector(1), qSacle);
          KalmanScalarFilter sf = new KalmanScalarFilter(0, qSacle);
  
          List<Datum> oneCluster = data.subList(201, 500);
          List<RealVector> vectorFiltered = oneCluster.stream().map(d -> vf.step(d.metrics().getSubVector(0, 1), 1)).collect(Collectors.toList());
          List<Double> scalarFiltered = oneCluster.stream()
                  .map(d -> sf.step(d.metrics().getEntry(0), 1))
                  .collect(Collectors.toList());
  
          for (int i=0; i<10; i++) {
              int ri = conf.getRandom().nextInt(300);
              assertEquals(vectorFiltered.get(ri).getEntry(0), scalarFiltered.get(ri));
          }
      }
test_case.class_method_signature: KalmanScalarFilterTest.reduceToVectorKalmanFilterTest()
test_case.full_signature: @Test public void reduceToVectorKalmanFilterTest()
test_case.identifier: reduceToVectorKalmanFilterTest
test_case.invocations: set set set set set set drainIngest assertEquals size subList collect map stream step getSubVector metrics toList collect map stream step getEntry metrics toList nextInt getRandom assertEquals getEntry get get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void reduceToVectorKalmanFilterTest()
focal_class.declarator: log = LoggerFactory.getLogger(KalmanScalarFilter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(KalmanScalarFilter.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: contrib/src/main/java/macrobase/analysis/stats/kalmanfilter/KalmanScalarFilter.java
focal_class.identifier: KalmanScalarFilter
focal_class.class_method_signature: KalmanScalarFilter.toVector(double x)
focal_class.full_signature: private static RealVector toVector(double x)
focal_class.identifier: toVector
focal_class.modifiers: private static
focal_class.parameters: (double x)
focal_class.return: RealVector
focal_class.signature: RealVector toVector(double x)
focal_class.class_method_signature: KalmanScalarFilter.KalmanScalarFilter(double startLoc, double qScale)
focal_class.full_signature: public  KalmanScalarFilter(double startLoc, double qScale)
focal_class.identifier: KalmanScalarFilter
focal_class.modifiers: public
focal_class.parameters: (double startLoc, double qScale)
focal_class.signature:  KalmanScalarFilter(double startLoc, double qScale)
focal_class.class_method_signature: KalmanScalarFilter.step(double observation, int time)
focal_class.full_signature: public double step(double observation, int time)
focal_class.identifier: step
focal_class.modifiers: public
focal_class.parameters: (double observation, int time)
focal_class.return: double
focal_class.signature: double step(double observation, int time)
focal_class.superclass: extends KalmanVectorFilter
focal_method.body: public double step(double observation, int time) {
          RealVector v = super.step(toVector(observation), time);
          return v.getEntry(0);
      }
focal_method.class_method_signature: KalmanScalarFilter.step(double observation, int time)
focal_method.full_signature: public double step(double observation, int time)
focal_method.identifier: step
focal_method.invocations: step toVector getEntry
focal_method.modifiers: public
focal_method.parameters: (double observation, int time)
focal_method.return: double
focal_method.signature: double step(double observation, int time)