Interface Feature


public interface Feature
A feature in the formula once bound to a schema. A feature returns a single value when applied to a data object (e.g. Tuple).
  • Method Summary

    Modifier and Type
    Method
    Description
    default BaseVector
    Applies the term on a data frame.
    apply(Tuple tuple)
    Applies the term on a tuple.
    default boolean
    Applies the term on a data object and produces a boolean-valued result.
    default byte
    Applies the term on a data object and produces a byte-valued result.
    default char
    Applies the term on a data object and produces a char-valued result.
    default double
    Applies the term on a data object and produces a double-valued result.
    default float
    Applies the term on a data object and produces a float-valued result.
    default int
    Applies the term on a data object and produces an int-valued result.
    default long
    Applies the term on a data object and produces a long-valued result.
    default short
    Applies the term on a data object and produces a short-valued result.
    Returns the metadata of feature.
    default boolean
    Returns true if the term represents a plain variable/column in the data frame.
  • Method Details

    • field

      StructField field()
      Returns the metadata of feature.
      Returns:
      the metadata of feature.
    • apply

      Object apply(Tuple tuple)
      Applies the term on a tuple.
      Parameters:
      tuple - the input tuple.
      Returns:
      the feature value.
    • applyAsDouble

      default double applyAsDouble(Tuple tuple)
      Applies the term on a data object and produces a double-valued result.
      Parameters:
      tuple - the input tuple.
      Returns:
      the feature value.
    • applyAsFloat

      default float applyAsFloat(Tuple tuple)
      Applies the term on a data object and produces a float-valued result.
      Parameters:
      tuple - the input tuple.
      Returns:
      the feature value.
    • applyAsInt

      default int applyAsInt(Tuple tuple)
      Applies the term on a data object and produces an int-valued result.
      Parameters:
      tuple - the input tuple.
      Returns:
      the feature value.
    • applyAsLong

      default long applyAsLong(Tuple tuple)
      Applies the term on a data object and produces a long-valued result.
      Parameters:
      tuple - the input tuple
      Returns:
      the feature value.
    • applyAsBoolean

      default boolean applyAsBoolean(Tuple tuple)
      Applies the term on a data object and produces a boolean-valued result.
      Parameters:
      tuple - the input tuple.
      Returns:
      the feature value.
    • applyAsByte

      default byte applyAsByte(Tuple tuple)
      Applies the term on a data object and produces a byte-valued result.
      Parameters:
      tuple - the input tuple.
      Returns:
      the feature value.
    • applyAsShort

      default short applyAsShort(Tuple tuple)
      Applies the term on a data object and produces a short-valued result.
      Parameters:
      tuple - the input tuple.
      Returns:
      the feature value.
    • applyAsChar

      default char applyAsChar(Tuple tuple)
      Applies the term on a data object and produces a char-valued result.
      Parameters:
      tuple - the input tuple.
      Returns:
      the feature value.
    • isVariable

      default boolean isVariable()
      Returns true if the term represents a plain variable/column in the data frame.
      Returns:
      true if the term represents a plain variable/column in the data frame.
    • apply

      default BaseVector apply(DataFrame data)
      Applies the term on a data frame.
      Parameters:
      data - the data frame.
      Returns:
      the feature vector.