test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/naivebayes/gaussian/GaussianNaiveBayesModelTest.java
test_class.identifier: GaussianNaiveBayesModelTest
test_case.body: @Test
      public void testPredictWithTwoClasses() {
          double first = 1;
          double second = 2;
          double[][] means = new double[][] {
              {5.855, 176.25, 11.25},
              {5.4175, 132.5, 7.5},
          };
          double[][] variances = new double[][] {
              {3.5033E-2, 1.2292E2, 9.1667E-1},
              {9.7225E-2, 5.5833E2, 1.6667},
          };
          double[] probabilities = new double[] {.5, .5};
          GaussianNaiveBayesModel mdl = new GaussianNaiveBayesModel(means, variances, probabilities, new double[] {first, second}, null);
          Vector observation = VectorUtils.of(6, 130, 8);
  
          Assert.assertEquals(second, mdl.predict(observation), 0.0001);
      }
test_case.class_method_signature: GaussianNaiveBayesModelTest.testPredictWithTwoClasses()
test_case.full_signature: @Test public void testPredictWithTwoClasses()
test_case.identifier: testPredictWithTwoClasses
test_case.invocations: of assertEquals predict
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPredictWithTwoClasses()
focal_class.declarator: serialVersionUID = -127386523291350345L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = -127386523291350345L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: means
focal_class.modifier: private final
focal_class.original_string: private final double[][] means;
focal_class.type: double[][]
focal_class.var_name: means
focal_class.declarator: variances
focal_class.modifier: private final
focal_class.original_string: private final double[][] variances;
focal_class.type: double[][]
focal_class.var_name: variances
focal_class.declarator: classProbabilities
focal_class.modifier: private final
focal_class.original_string: private final double[] classProbabilities;
focal_class.type: double[]
focal_class.var_name: classProbabilities
focal_class.declarator: labels
focal_class.modifier: private final
focal_class.original_string: private final double[] labels;
focal_class.type: double[]
focal_class.var_name: labels
focal_class.declarator: sumsHolder
focal_class.modifier: private final
focal_class.original_string: private final GaussianNaiveBayesSumsHolder sumsHolder;
focal_class.type: GaussianNaiveBayesSumsHolder
focal_class.var_name: sumsHolder
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/naivebayes/gaussian/GaussianNaiveBayesModel.java
focal_class.identifier: GaussianNaiveBayesModel
focal_class.interfaces: implements IgniteModel<Vector, Double>, Exportable<GaussianNaiveBayesModel>, Serializable
focal_class.class_method_signature: GaussianNaiveBayesModel.GaussianNaiveBayesModel(double[][] means, double[][] variances,
          double[] classProbabilities, double[] labels, GaussianNaiveBayesSumsHolder sumsHolder)
focal_class.full_signature: public  GaussianNaiveBayesModel(double[][] means, double[][] variances,
          double[] classProbabilities, double[] labels, GaussianNaiveBayesSumsHolder sumsHolder)
focal_class.identifier: GaussianNaiveBayesModel
focal_class.modifiers: public
focal_class.parameters: (double[][] means, double[][] variances,
          double[] classProbabilities, double[] labels, GaussianNaiveBayesSumsHolder sumsHolder)
focal_class.signature:  GaussianNaiveBayesModel(double[][] means, double[][] variances,
          double[] classProbabilities, double[] labels, GaussianNaiveBayesSumsHolder sumsHolder)
focal_class.class_method_signature: GaussianNaiveBayesModel.saveModel(Exporter<GaussianNaiveBayesModel, P> exporter, P path)
focal_class.full_signature: @Override public void saveModel(Exporter<GaussianNaiveBayesModel, P> exporter, P path)
focal_class.identifier: saveModel
focal_class.modifiers: @Override public
focal_class.parameters: (Exporter<GaussianNaiveBayesModel, P> exporter, P path)
focal_class.return: void
focal_class.signature: void saveModel(Exporter<GaussianNaiveBayesModel, P> exporter, P path)
focal_class.class_method_signature: GaussianNaiveBayesModel.predict(Vector vector)
focal_class.full_signature: @Override public Double predict(Vector vector)
focal_class.identifier: predict
focal_class.modifiers: @Override public
focal_class.parameters: (Vector vector)
focal_class.return: Double
focal_class.signature: Double predict(Vector vector)
focal_class.class_method_signature: GaussianNaiveBayesModel.getMeans()
focal_class.full_signature: public double[][] getMeans()
focal_class.identifier: getMeans
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double[][]
focal_class.signature: double[][] getMeans()
focal_class.class_method_signature: GaussianNaiveBayesModel.getVariances()
focal_class.full_signature: public double[][] getVariances()
focal_class.identifier: getVariances
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double[][]
focal_class.signature: double[][] getVariances()
focal_class.class_method_signature: GaussianNaiveBayesModel.getClassProbabilities()
focal_class.full_signature: public double[] getClassProbabilities()
focal_class.identifier: getClassProbabilities
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double[]
focal_class.signature: double[] getClassProbabilities()
focal_class.class_method_signature: GaussianNaiveBayesModel.getSumsHolder()
focal_class.full_signature: public GaussianNaiveBayesSumsHolder getSumsHolder()
focal_class.identifier: getSumsHolder
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: GaussianNaiveBayesSumsHolder
focal_class.signature: GaussianNaiveBayesSumsHolder getSumsHolder()
focal_class.class_method_signature: GaussianNaiveBayesModel.gauss(double x, double mean, double variance)
focal_class.full_signature: private double gauss(double x, double mean, double variance)
focal_class.identifier: gauss
focal_class.modifiers: private
focal_class.parameters: (double x, double mean, double variance)
focal_class.return: double
focal_class.signature: double gauss(double x, double mean, double variance)
focal_method.body: @Override public Double predict(Vector vector) {
          int k = classProbabilities.length;
  
          double maxProbability = .0;
          int max = 0;
  
          for (int i = 0; i < k; i++) {
              double p = classProbabilities[i];
              for (int j = 0; j < vector.size(); j++) {
                  double x = vector.get(j);
                  double g = gauss(x, means[i][j], variances[i][j]);
                  p *= g;
              }
              if (p > maxProbability) {
                  max = i;
                  maxProbability = p;
              }
          }
          return labels[max];
      }
focal_method.class_method_signature: GaussianNaiveBayesModel.predict(Vector vector)
focal_method.full_signature: @Override public Double predict(Vector vector)
focal_method.identifier: predict
focal_method.invocations: size get gauss
focal_method.modifiers: @Override public
focal_method.parameters: (Vector vector)
focal_method.return: Double
focal_method.signature: Double predict(Vector vector)