test_class.declarator: log = LoggerFactory.getLogger(KalmanFlattenedMatrixFilterTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger log = LoggerFactory.getLogger(KalmanFlattenedMatrixFilterTest.class);
test_class.type: Logger
test_class.var_name: log
test_class.file: contrib/src/test/java/macrobase/analysis/stats/kalmanfilter/KalmanFlattenedMatrixFilterTest.java
test_class.identifier: KalmanFlattenedMatrixFilterTest
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());
  
          KalmanVectorFilter f = new KalmanVectorFilter(new ArrayRealVector(2), 1e-6, 1);
  
          RealMatrix shapeMatrix = new BlockRealMatrix(2, 1);
          KalmanFlattenedMatrixFilter mf = new KalmanFlattenedMatrixFilter(shapeMatrix, 1e-6, 1);
  
          List<Datum> oneCluster = data.subList(201, 500);
          List<RealVector> vectorFiltered = oneCluster.stream().map(d -> f.step(d.metrics(), 1)).collect(Collectors.toList());
          List<RealMatrix> matrixFiltered = oneCluster.stream()
                  .map(d -> mf.step(AlgebraUtils.reshapeMatrixByColumns(d.metrics(), shapeMatrix), 1))
                  .collect(Collectors.toList());
  
          for (int i = 0; i < 10; i++) {
              int ri = conf.getRandom().nextInt(300);
              assertEquals(vectorFiltered.get(ri), AlgebraUtils.flattenMatrixByColumns(matrixFiltered.get(ri)));
          }
      }
test_case.class_method_signature: KalmanFlattenedMatrixFilterTest.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 metrics toList collect map stream step reshapeMatrixByColumns metrics toList nextInt getRandom assertEquals get flattenMatrixByColumns get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void reduceToVectorKalmanFilterTest()
focal_class.declarator: log = LoggerFactory.getLogger(KalmanFlattenedMatrixFilter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(KalmanFlattenedMatrixFilter.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: contrib/src/main/java/macrobase/analysis/stats/kalmanfilter/KalmanFlattenedMatrixFilter.java
focal_class.identifier: KalmanFlattenedMatrixFilter
focal_class.class_method_signature: KalmanFlattenedMatrixFilter.KalmanFlattenedMatrixFilter(RealMatrix startLoc, double qScale, double rScale)
focal_class.full_signature: public  KalmanFlattenedMatrixFilter(RealMatrix startLoc, double qScale, double rScale)
focal_class.identifier: KalmanFlattenedMatrixFilter
focal_class.modifiers: public
focal_class.parameters: (RealMatrix startLoc, double qScale, double rScale)
focal_class.signature:  KalmanFlattenedMatrixFilter(RealMatrix startLoc, double qScale, double rScale)
focal_class.class_method_signature: KalmanFlattenedMatrixFilter.step(RealMatrix observation, int time)
focal_class.full_signature: public RealMatrix step(RealMatrix observation, int time)
focal_class.identifier: step
focal_class.modifiers: public
focal_class.parameters: (RealMatrix observation, int time)
focal_class.return: RealMatrix
focal_class.signature: RealMatrix step(RealMatrix observation, int time)
focal_class.superclass: extends KalmanVectorFilter
focal_method.body: public RealMatrix step(RealMatrix observation, int time) {
          RealVector v = super.step(AlgebraUtils.flattenMatrixByColumns(observation), time);
          return AlgebraUtils.reshapeMatrixByColumns(v, observation);
      }
focal_method.class_method_signature: KalmanFlattenedMatrixFilter.step(RealMatrix observation, int time)
focal_method.full_signature: public RealMatrix step(RealMatrix observation, int time)
focal_method.identifier: step
focal_method.invocations: step flattenMatrixByColumns reshapeMatrixByColumns
focal_method.modifiers: public
focal_method.parameters: (RealMatrix observation, int time)
focal_method.return: RealMatrix
focal_method.signature: RealMatrix step(RealMatrix observation, int time)