You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Anton Dmitriev (JIRA)" <ji...@apache.org> on 2019/03/29 09:43:00 UTC

[jira] [Created] (IGNITE-11655) ML: OneHotEncoder returns more columns than expected

Anton Dmitriev created IGNITE-11655:
---------------------------------------

             Summary: ML: OneHotEncoder returns more columns than expected
                 Key: IGNITE-11655
                 URL: https://issues.apache.org/jira/browse/IGNITE-11655
             Project: Ignite
          Issue Type: Bug
            Reporter: Anton Dmitriev


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]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)