anchor.diff:            });
       });
   
  +    test('should decode categorical data', () async {
  +      await testCsvWithCategories(
  +        fileName: 'test/data_preprocessing/test_data/fake_data.csv',
  +        labelIdx: 3,
  +        rowNum: 7,
  +        columns: [
  +          const Tuple2(0, 3),
  +        ],
  +        categoryIndexToEncoder: {
  +          0: CategoricalDataEncoderType.oneHot,
  +          1: CategoricalDataEncoderType.ordinal,
  +          2: CategoricalDataEncoderType.oneHot,
  +        },
  +        testContentFn: (features, labels, header, dataFrame) {
  +          final decoded = dataFrame.decode(Matrix.from([
  +            [1.0, 0.0, 0.0],
  +            [0.0, 1.0, 0.0],
  +            [0.0, 0.0, 1.0],
  +            [0.0, 1.0, 0.0],
  +            [0.0, 1.0, 0.0],
  +            [1.0, 0.0, 0.0],
  +            [0.0, 0.0, 1.0],
  +          ]), colName: 'feature_1');
  +          expect(decoded, equals(['value_1_1', 'value_1_2', 'value_1_3',
  +            'value_1_2', 'value_1_2', 'value_1_1', 'value_1_3']));
  +        });
  +    });
  +
       test('should encode categorical data in headless dataset', () async {
         await testCsvWithCategories(
             fileName: 'test/data_preprocessing/test_data/fake_data_headless.csv',
  
positive.code:             1: CategoricalDataEncoderType.ordinal,
              2: CategoricalDataEncoderType.oneHot,
            },
            testContentFn: (features, labels, header) {
              expect(header,
                  equals(['feature_1', 'feature_2', 'feature_3', 'score']));
              expect(
  
negative.code:     List<Tuple2<int, int>> columns,
      Map<String, CategoricalDataEncoderType> categoryNameToEncoder,
      Map<int, CategoricalDataEncoderType> categoryIndexToEncoder,
      void testContentFn(Matrix features, Matrix labels, List<String> headers,
          DataFrame dataFrame)}) async {
    final dataFrame = CsvDataFrame.fromFile(fileName,
        labelIdx: labelIdx,
        columns: columns,
        headerExists: headerExist,
        categoryNameToEncoder: categoryNameToEncoder,
        categoryIndexToEncoder: categoryIndexToEncoder,
    );
    final header = await dataFrame.header;
    final features = await dataFrame.features;
    final labels = await dataFrame.labels;
  
    expect(features.rowsNum, equals(rowNum));
    expect(labels.rowsNum, equals(rowNum));
  
    testContentFn(features, labels, header, dataFrame);
  }
  
  void main() {
  