test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/clustering/gmm/CovarianceMatricesAggregatorTest.java
test_class.identifier: CovarianceMatricesAggregatorTest
test_case.body: @Test
      public void testMap() {
          List<LabeledVector<Double>> xs = Arrays.asList(
              new LabeledVector<>(VectorUtils.of(1, 0), 0.),
              new LabeledVector<>(VectorUtils.of(0, 1), 0.),
              new LabeledVector<>(VectorUtils.of(1, 1), 0.)
          );
  
          double[][] pcxi = new double[][] {
              new double[] {0.1, 0.2},
              new double[] {0.4, 0.3},
              new double[] {0.5, 0.6}
          };
  
          GmmPartitionData data = new GmmPartitionData(xs, pcxi);
          Vector mean1 = VectorUtils.of(1, 1);
          Vector mean2 = VectorUtils.of(0, 1);
          List<CovarianceMatricesAggregator> result = CovarianceMatricesAggregator.map(data, new Vector[] {mean1, mean2});
  
          assertEquals(pcxi[0].length, result.size());
  
          CovarianceMatricesAggregator res1 = result.get(0);
          assertArrayEquals(mean1.asArray(), res1.mean().asArray(), 1e-4);
          assertArrayEquals(
              res1.weightedSum().getStorage().data(),
              fromArray(2, 0.4, 0., 0., 0.1).getStorage().data(),
              1e-4
          );
          assertEquals(3, res1.rowCount());
  
          CovarianceMatricesAggregator res2 = result.get(1);
          assertArrayEquals(mean2.asArray(), res2.mean().asArray(), 1e-4);
          assertArrayEquals(
              res2.weightedSum().getStorage().data(),
              fromArray(2, 0.8, -0.2, -0.2, 0.2).getStorage().data(),
              1e-4
          );
          assertEquals(3, res2.rowCount());
      }
test_case.class_method_signature: CovarianceMatricesAggregatorTest.testMap()
test_case.full_signature: @Test public void testMap()
test_case.identifier: testMap
test_case.invocations: asList of of of of of map assertEquals size get assertArrayEquals asArray asArray mean assertArrayEquals data getStorage weightedSum data getStorage fromArray assertEquals rowCount get assertArrayEquals asArray asArray mean assertArrayEquals data getStorage weightedSum data getStorage fromArray assertEquals rowCount
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMap()
focal_class.declarator: serialVersionUID = 4163253784526780812L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 4163253784526780812L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: mean
focal_class.modifier: private final
focal_class.original_string: private final Vector mean;
focal_class.type: Vector
focal_class.var_name: mean
focal_class.declarator: weightedSum
focal_class.modifier: private
focal_class.original_string: private Matrix weightedSum;
focal_class.type: Matrix
focal_class.var_name: weightedSum
focal_class.declarator: rowCount
focal_class.modifier: private
focal_class.original_string: private int rowCount;
focal_class.type: int
focal_class.var_name: rowCount
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/clustering/gmm/CovarianceMatricesAggregator.java
focal_class.identifier: CovarianceMatricesAggregator
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: CovarianceMatricesAggregator.CovarianceMatricesAggregator(Vector mean)
focal_class.full_signature:   CovarianceMatricesAggregator(Vector mean)
focal_class.identifier: CovarianceMatricesAggregator
focal_class.parameters: (Vector mean)
focal_class.signature:  CovarianceMatricesAggregator(Vector mean)
focal_class.class_method_signature: CovarianceMatricesAggregator.CovarianceMatricesAggregator(Vector mean, Matrix weightedSum, int rowCount)
focal_class.full_signature:   CovarianceMatricesAggregator(Vector mean, Matrix weightedSum, int rowCount)
focal_class.identifier: CovarianceMatricesAggregator
focal_class.parameters: (Vector mean, Matrix weightedSum, int rowCount)
focal_class.signature:  CovarianceMatricesAggregator(Vector mean, Matrix weightedSum, int rowCount)
focal_class.class_method_signature: CovarianceMatricesAggregator.computeCovariances(Dataset<EmptyContext, GmmPartitionData> dataset,
          Vector clusterProbs, Vector[] means)
focal_class.full_signature: static List<Matrix> computeCovariances(Dataset<EmptyContext, GmmPartitionData> dataset,
          Vector clusterProbs, Vector[] means)
focal_class.identifier: computeCovariances
focal_class.modifiers: static
focal_class.parameters: (Dataset<EmptyContext, GmmPartitionData> dataset,
          Vector clusterProbs, Vector[] means)
focal_class.return: List<Matrix>
focal_class.signature: List<Matrix> computeCovariances(Dataset<EmptyContext, GmmPartitionData> dataset,
          Vector clusterProbs, Vector[] means)
focal_class.class_method_signature: CovarianceMatricesAggregator.add(Vector x, double pcxi)
focal_class.full_signature:  void add(Vector x, double pcxi)
focal_class.identifier: add
focal_class.parameters: (Vector x, double pcxi)
focal_class.return: void
focal_class.signature: void add(Vector x, double pcxi)
focal_class.class_method_signature: CovarianceMatricesAggregator.plus(CovarianceMatricesAggregator other)
focal_class.full_signature:  CovarianceMatricesAggregator plus(CovarianceMatricesAggregator other)
focal_class.identifier: plus
focal_class.parameters: (CovarianceMatricesAggregator other)
focal_class.return: CovarianceMatricesAggregator
focal_class.signature: CovarianceMatricesAggregator plus(CovarianceMatricesAggregator other)
focal_class.class_method_signature: CovarianceMatricesAggregator.map(GmmPartitionData data, Vector[] means)
focal_class.full_signature: static List<CovarianceMatricesAggregator> map(GmmPartitionData data, Vector[] means)
focal_class.identifier: map
focal_class.modifiers: static
focal_class.parameters: (GmmPartitionData data, Vector[] means)
focal_class.return: List<CovarianceMatricesAggregator>
focal_class.signature: List<CovarianceMatricesAggregator> map(GmmPartitionData data, Vector[] means)
focal_class.class_method_signature: CovarianceMatricesAggregator.covariance(double clusterProb)
focal_class.full_signature: private Matrix covariance(double clusterProb)
focal_class.identifier: covariance
focal_class.modifiers: private
focal_class.parameters: (double clusterProb)
focal_class.return: Matrix
focal_class.signature: Matrix covariance(double clusterProb)
focal_class.class_method_signature: CovarianceMatricesAggregator.reduce(List<CovarianceMatricesAggregator> l,
          List<CovarianceMatricesAggregator> r)
focal_class.full_signature: static List<CovarianceMatricesAggregator> reduce(List<CovarianceMatricesAggregator> l,
          List<CovarianceMatricesAggregator> r)
focal_class.identifier: reduce
focal_class.modifiers: static
focal_class.parameters: (List<CovarianceMatricesAggregator> l,
          List<CovarianceMatricesAggregator> r)
focal_class.return: List<CovarianceMatricesAggregator>
focal_class.signature: List<CovarianceMatricesAggregator> reduce(List<CovarianceMatricesAggregator> l,
          List<CovarianceMatricesAggregator> r)
focal_class.class_method_signature: CovarianceMatricesAggregator.mean()
focal_class.full_signature:  Vector mean()
focal_class.identifier: mean
focal_class.parameters: ()
focal_class.return: Vector
focal_class.signature: Vector mean()
focal_class.class_method_signature: CovarianceMatricesAggregator.weightedSum()
focal_class.full_signature:  Matrix weightedSum()
focal_class.identifier: weightedSum
focal_class.parameters: ()
focal_class.return: Matrix
focal_class.signature: Matrix weightedSum()
focal_class.class_method_signature: CovarianceMatricesAggregator.rowCount()
focal_class.full_signature: public int rowCount()
focal_class.identifier: rowCount
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int rowCount()
focal_method.body: static List<CovarianceMatricesAggregator> map(GmmPartitionData data, Vector[] means) {
          int countOfComponents = means.length;
  
          List<CovarianceMatricesAggregator> aggregators = new ArrayList<>();
          for (int i = 0; i < countOfComponents; i++)
              aggregators.add(new CovarianceMatricesAggregator(means[i]));
  
          for (int i = 0; i < data.size(); i++) {
              for (int c = 0; c < countOfComponents; c++)
                  aggregators.get(c).add(data.getX(i), data.pcxi(c, i));
          }
  
          return aggregators;
      }
focal_method.class_method_signature: CovarianceMatricesAggregator.map(GmmPartitionData data, Vector[] means)
focal_method.full_signature: static List<CovarianceMatricesAggregator> map(GmmPartitionData data, Vector[] means)
focal_method.identifier: map
focal_method.invocations: add size add get getX pcxi
focal_method.modifiers: static
focal_method.parameters: (GmmPartitionData data, Vector[] means)
focal_method.return: List<CovarianceMatricesAggregator>
focal_method.signature: List<CovarianceMatricesAggregator> map(GmmPartitionData data, Vector[] means)