test_class.declarator: useIdx
test_class.modifier: @Parameterized.Parameter
      public
test_class.original_string: @Parameterized.Parameter
      public boolean useIdx;
test_class.type: boolean
test_class.var_name: useIdx
test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/tree/data/DecisionTreeDataTest.java
test_class.identifier: DecisionTreeDataTest
test_case.body: @Test
      public void testFilter() {
          double[][] features = new double[][]{{0}, {1}, {2}, {3}, {4}, {5}};
          double[] labels = new double[]{0, 1, 2, 3, 4, 5};
  
          DecisionTreeData data = new DecisionTreeData(features, labels, useIdx);
          DecisionTreeData filteredData = data.filter(obj -> obj[0] > 2);
  
          assertArrayEquals(new double[][]{{3}, {4}, {5}}, filteredData.getFeatures());
          assertArrayEquals(new double[]{3, 4, 5}, filteredData.getLabels(), 1e-10);
      }
test_case.class_method_signature: DecisionTreeDataTest.testFilter()
test_case.full_signature: @Test public void testFilter()
test_case.identifier: testFilter
test_case.invocations: filter assertArrayEquals getFeatures assertArrayEquals getLabels
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFilter()
focal_class.declarator: copiedOriginalLabels
focal_class.modifier: private
focal_class.original_string: private double[] copiedOriginalLabels;
focal_class.type: double[]
focal_class.var_name: copiedOriginalLabels
focal_class.declarator: indexesCache
focal_class.modifier: private final
focal_class.original_string: private final List<TreeDataIndex> indexesCache;
focal_class.type: List<TreeDataIndex>
focal_class.var_name: indexesCache
focal_class.declarator: buildIdx
focal_class.modifier: private final
focal_class.original_string: private final boolean buildIdx;
focal_class.type: boolean
focal_class.var_name: buildIdx
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/tree/data/DecisionTreeData.java
focal_class.identifier: DecisionTreeData
focal_class.interfaces: implements AutoCloseable
focal_class.class_method_signature: DecisionTreeData.DecisionTreeData(double[][] features, double[] labels, boolean buildIdx)
focal_class.full_signature: public  DecisionTreeData(double[][] features, double[] labels, boolean buildIdx)
focal_class.identifier: DecisionTreeData
focal_class.modifiers: public
focal_class.parameters: (double[][] features, double[] labels, boolean buildIdx)
focal_class.signature:  DecisionTreeData(double[][] features, double[] labels, boolean buildIdx)
focal_class.class_method_signature: DecisionTreeData.filter(TreeFilter filter)
focal_class.full_signature: public DecisionTreeData filter(TreeFilter filter)
focal_class.identifier: filter
focal_class.modifiers: public
focal_class.parameters: (TreeFilter filter)
focal_class.return: DecisionTreeData
focal_class.signature: DecisionTreeData filter(TreeFilter filter)
focal_class.class_method_signature: DecisionTreeData.sort(int col)
focal_class.full_signature: public void sort(int col)
focal_class.identifier: sort
focal_class.modifiers: public
focal_class.parameters: (int col)
focal_class.return: void
focal_class.signature: void sort(int col)
focal_class.class_method_signature: DecisionTreeData.sort(int col, int from, int to)
focal_class.full_signature: private void sort(int col, int from, int to)
focal_class.identifier: sort
focal_class.modifiers: private
focal_class.parameters: (int col, int from, int to)
focal_class.return: void
focal_class.signature: void sort(int col, int from, int to)
focal_class.class_method_signature: DecisionTreeData.getCopiedOriginalLabels()
focal_class.full_signature: public double[] getCopiedOriginalLabels()
focal_class.identifier: getCopiedOriginalLabels
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double[]
focal_class.signature: double[] getCopiedOriginalLabels()
focal_class.class_method_signature: DecisionTreeData.setCopiedOriginalLabels(double[] copiedOriginalLabels)
focal_class.full_signature: public void setCopiedOriginalLabels(double[] copiedOriginalLabels)
focal_class.identifier: setCopiedOriginalLabels
focal_class.modifiers: public
focal_class.parameters: (double[] copiedOriginalLabels)
focal_class.return: void
focal_class.signature: void setCopiedOriginalLabels(double[] copiedOriginalLabels)
focal_class.class_method_signature: DecisionTreeData.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: DecisionTreeData.createIndexByFilter(int depth, TreeFilter filter)
focal_class.full_signature: public TreeDataIndex createIndexByFilter(int depth, TreeFilter filter)
focal_class.identifier: createIndexByFilter
focal_class.modifiers: public
focal_class.parameters: (int depth, TreeFilter filter)
focal_class.return: TreeDataIndex
focal_class.signature: TreeDataIndex createIndexByFilter(int depth, TreeFilter filter)
focal_class.superclass: extends FeatureMatrixWithLabelsOnHeapData
focal_method.body: public DecisionTreeData filter(TreeFilter filter) {
          int size = 0;
  
          double[][] features = getFeatures();
          double[] labels = getLabels();
          for (int i = 0; i < features.length; i++)
              if (filter.test(features[i]))
                  size++;
  
          double[][] newFeatures = new double[size][];
          double[] newLabels = new double[size];
  
          int ptr = 0;
  
          for (int i = 0; i < features.length; i++) {
              if (filter.test(features[i])) {
                  newFeatures[ptr] = features[i];
                  newLabels[ptr] = labels[i];
  
                  ptr++;
              }
          }
  
          return new DecisionTreeData(newFeatures, newLabels, buildIdx);
      }
focal_method.class_method_signature: DecisionTreeData.filter(TreeFilter filter)
focal_method.full_signature: public DecisionTreeData filter(TreeFilter filter)
focal_method.identifier: filter
focal_method.invocations: getFeatures getLabels test test
focal_method.modifiers: public
focal_method.parameters: (TreeFilter filter)
focal_method.return: DecisionTreeData
focal_method.signature: DecisionTreeData filter(TreeFilter filter)