docs: @Override
      public Object map(Object input) {
          String str = input.toString();
          List<Integer> oneHot = new ArrayList<>();
          int n = stateNames.size();
          Integer classIdx = statesMap.get(str);
          if (classIdx == null) {
              throw new IllegalStateException("Cannot convert categorical value to one-hot: input value (\"" + str
                      + "\") is not in the list of known categories (state names/categories: " + stateNames + ")");
          }
          for (int j = 0; j < n; j++) {
              if (j == classIdx)
                  oneHot.add(1);
              else
                  oneHot.add(0);
          }
          return oneHot;
      }