docs: @Override
      public Object map(Object input) {
          String value = input.toString();
          //Do conversion
          Integer classIdx = statesMap.get(value);
          if (classIdx == null) {
              throw new IllegalStateException("Cannot convert categorical value to integer value: input value (\"" + value
                      + "\") is not in the list of known categories (state names/categories: " + stateNames + ")");
          }
          return classIdx;
      }