test_class.declarator: datasetBuilder
test_class.modifier: private
test_class.original_string: private DatasetBuilder<Integer, Vector> datasetBuilder;
test_class.type: DatasetBuilder<Integer, Vector>
test_class.var_name: datasetBuilder
test_class.declarator: standardizationTrainer
test_class.modifier: private
test_class.original_string: private StandardScalerTrainer<Integer, Vector> standardizationTrainer;
test_class.type: StandardScalerTrainer<Integer, Vector>
test_class.var_name: standardizationTrainer
test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/preprocessing/standardscaling/StandardScalerTrainerTest.java
test_class.identifier: StandardScalerTrainerTest
test_class.superclass: extends TrainerTest
test_case.body: @Test
      public void testCalculatesCorrectStandardDeviations() {
          double[] expectedSigmas = new double[] {0.5, 1.47901995, 14.51723114, 0.93374247};
  
          final Vectorizer<Integer, Vector, Integer, Double> vectorizer = new DummyVectorizer<>(0, 1, 2, 3);
  
          StandardScalerPreprocessor<Integer, Vector> preprocessor = (StandardScalerPreprocessor<Integer, Vector>)standardizationTrainer.fit(
              TestUtils.testEnvBuilder(),
              datasetBuilder,
              vectorizer
          );
  
          assertArrayEquals(expectedSigmas, preprocessor.getSigmas(), 1e-8);
      }
test_case.class_method_signature: StandardScalerTrainerTest.testCalculatesCorrectStandardDeviations()
test_case.full_signature: @Test public void testCalculatesCorrectStandardDeviations()
test_case.identifier: testCalculatesCorrectStandardDeviations
test_case.invocations: fit testEnvBuilder assertArrayEquals getSigmas
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCalculatesCorrectStandardDeviations()
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/preprocessing/standardscaling/StandardScalerTrainer.java
focal_class.identifier: StandardScalerTrainer
focal_class.interfaces: implements PreprocessingTrainer<K, V>
focal_class.class_method_signature: StandardScalerTrainer.fit(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_class.full_signature: @Override public StandardScalerPreprocessor<K, V> fit(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_class.identifier: fit
focal_class.modifiers: @Override public
focal_class.parameters: (LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_class.return: StandardScalerPreprocessor<K, V>
focal_class.signature: StandardScalerPreprocessor<K, V> fit(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_class.class_method_signature: StandardScalerTrainer.computeSum(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_class.full_signature: private StandardScalerData computeSum(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_class.identifier: computeSum
focal_class.modifiers: private
focal_class.parameters: (LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_class.return: StandardScalerData
focal_class.signature: StandardScalerData computeSum(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_method.body: @Override public StandardScalerPreprocessor<K, V> fit(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor) {
          StandardScalerData standardScalerData = computeSum(envBuilder, datasetBuilder, basePreprocessor);
  
          int n = standardScalerData.sum.length;
          long cnt = standardScalerData.cnt;
          double[] mean = new double[n];
          double[] sigma = new double[n];
  
          for (int i = 0; i < n; i++) {
              mean[i] = standardScalerData.sum[i] / cnt;
              double variance = (standardScalerData.squaredSum[i] - Math.pow(standardScalerData.sum[i], 2) / cnt) / cnt;
              sigma[i] = Math.sqrt(variance);
          }
          return new StandardScalerPreprocessor<>(mean, sigma, basePreprocessor);
      }
focal_method.class_method_signature: StandardScalerTrainer.fit(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_method.full_signature: @Override public StandardScalerPreprocessor<K, V> fit(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_method.identifier: fit
focal_method.invocations: computeSum pow sqrt
focal_method.modifiers: @Override public
focal_method.parameters: (LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)
focal_method.return: StandardScalerPreprocessor<K, V>
focal_method.signature: StandardScalerPreprocessor<K, V> fit(LearningEnvironmentBuilder envBuilder,
          DatasetBuilder<K, V> datasetBuilder,
          Preprocessor<K, V> basePreprocessor)