Class StringListToCountsNDArrayTransform

    • Field Detail

      • columnName

        protected final String columnName
      • newColumnName

        protected final String newColumnName
      • vocabulary

        protected final List<String> vocabulary
      • delimiter

        protected final String delimiter
      • binary

        protected final boolean binary
      • ignoreUnknown

        protected final boolean ignoreUnknown
      • columnIdx

        protected int columnIdx
    • Constructor Detail

      • StringListToCountsNDArrayTransform

        public StringListToCountsNDArrayTransform​(String columnName,
                                                  List<String> vocabulary,
                                                  String delimiter,
                                                  boolean binary,
                                                  boolean ignoreUnknown)
        Parameters:
        columnName - The name of the column to convert
        vocabulary - The possible tokens that may be present.
        delimiter - The delimiter for the Strings to convert
        ignoreUnknown - Whether to ignore unknown tokens
      • StringListToCountsNDArrayTransform

        public StringListToCountsNDArrayTransform​(String columnName,
                                                  String newColumnName,
                                                  List<String> vocabulary,
                                                  String delimiter,
                                                  boolean binary,
                                                  boolean ignoreUnknown)
        Parameters:
        columnName - The name of the column to convert
        vocabulary - The possible tokens that may be present.
        delimiter - The delimiter for the Strings to convert
        ignoreUnknown - Whether to ignore unknown tokens
    • Method Detail

      • transform

        public Schema transform​(Schema inputSchema)
      • map

        public List<Writable> map​(List<Writable> writables)
        Description copied from interface: Transform
        Transform a writable in to another writable
        Parameters:
        writables - the record to transform
        Returns:
        the transformed writable
      • map

        public Object map​(Object input)
        Transform an object in to another object
        Parameters:
        input - the record to transform
        Returns:
        the transformed writable
      • mapSequence

        public Object mapSequence​(Object sequence)
        Transform a sequence
        Parameters:
        sequence -
      • outputColumnName

        public String outputColumnName()
        The output column name after the operation has been applied
        Returns:
        the output column name
      • outputColumnNames

        public String[] outputColumnNames()
        The output column names This will often be the same as the input
        Returns:
        the output column names
      • columnNames

        public String[] columnNames()
        Returns column names this op is meant to run on
        Returns:
      • columnName

        public String columnName()
        Returns a singular column name this op is meant to run on
        Returns: