@Override
    public int[] apply(Tuple x) {
        int[] features = new int[columns.length];
        for (int i = 0; i < features.length; i++) {
            features[i] = x.getInt(columns[i]) + base[i];
        }

        return features;
    }
@Test
    public void test() {
        System.out.println("Binary Encoder");
        int[][] result = {
            {0, 3, 6, 9},
            {0, 3, 6, 8},
            {1, 3, 6, 9},
            {2, 4, 6, 9},
            {2, 5, 7, 9},
            {2, 5, 7, 8},
            {1, 5, 7, 8},
            {0, 4, 6, 9},
            {0, 5, 7, 9},
            {2, 4, 7, 9},
            {0, 4, 7, 8},
            {1, 4, 6, 8},
            {1, 3, 7, 9},
            {2, 4, 6, 8}
        };

        DataFrame data = WeatherNominal.data;
        BinaryEncoder encoder = new BinaryEncoder(data.schema(), "outlook", "temperature", "humidity", "windy");
        int[][] onehot = encoder.apply(data);

        for (int i = 0; i < data.size(); i++) {
            for (int j = 0; j < result[i].length; j++) {
                assertEquals(result[i][j], onehot[i][j]);
            }
        }
    }