Details
Description
OneHotEncoder returns more columns than expected (two values that might be encoded using two columns encoded using 3 columns). The following example demonstrates the problem:
Map<Integer, Object[]> training = new HashMap<>(); training.put(0, new Object[]{42.0}); training.put(1, new Object[]{43.0}); training.put(2, new Object[]{42.0}); EncoderTrainer<Integer, Object[]> trainer = new EncoderTrainer<Integer, Object[]>() .withEncoderType(EncoderType.ONE_HOT_ENCODER) .withEncodedFeature(0); IgniteBiFunction<Integer, Object[], Vector> processor = trainer.fit(training, 1, (k, v) -> v); Vector res = processor.apply(1, new Object[]{42.0}); System.out.println(Arrays.toString(res.asArray())); >>> [0.0, 1.0, 0.0]
Attachments
Issue Links
- links to