Package smile.data.formula
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 TypeMethodDescriptiondefault BaseVector
Applies the term on a data frame.Applies the term on a tuple.default boolean
applyAsBoolean
(Tuple tuple) Applies the term on a data object and produces a boolean-valued result.default byte
applyAsByte
(Tuple tuple) Applies the term on a data object and produces a byte-valued result.default char
applyAsChar
(Tuple tuple) Applies the term on a data object and produces a char-valued result.default double
applyAsDouble
(Tuple tuple) Applies the term on a data object and produces a double-valued result.default float
applyAsFloat
(Tuple tuple) Applies the term on a data object and produces a float-valued result.default int
applyAsInt
(Tuple tuple) Applies the term on a data object and produces an int-valued result.default long
applyAsLong
(Tuple tuple) Applies the term on a data object and produces a long-valued result.default short
applyAsShort
(Tuple tuple) Applies the term on a data object and produces a short-valued result.field()
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
Applies the term on a tuple.- Parameters:
tuple
- the input tuple.- Returns:
- the feature value.
-
applyAsDouble
Applies the term on a data object and produces a double-valued result.- Parameters:
tuple
- the input tuple.- Returns:
- the feature value.
-
applyAsFloat
Applies the term on a data object and produces a float-valued result.- Parameters:
tuple
- the input tuple.- Returns:
- the feature value.
-
applyAsInt
Applies the term on a data object and produces an int-valued result.- Parameters:
tuple
- the input tuple.- Returns:
- the feature value.
-
applyAsLong
Applies the term on a data object and produces a long-valued result.- Parameters:
tuple
- the input tuple- Returns:
- the feature value.
-
applyAsBoolean
Applies the term on a data object and produces a boolean-valued result.- Parameters:
tuple
- the input tuple.- Returns:
- the feature value.
-
applyAsByte
Applies the term on a data object and produces a byte-valued result.- Parameters:
tuple
- the input tuple.- Returns:
- the feature value.
-
applyAsShort
Applies the term on a data object and produces a short-valued result.- Parameters:
tuple
- the input tuple.- Returns:
- the feature value.
-
applyAsChar
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
Applies the term on a data frame.- Parameters:
data
- the data frame.- Returns:
- the feature vector.
-