Feature logic is the series of steps that transform input data into the unencoded data value that represents the feature in the feature store. The encoding step, which is model-specific, is not typically considered part of the feature logic.
In feature engineering, we describe how your choice of framework depends on your feature freshness requirements and data processing volume - with popular frameworks including Pandas, Polars, Spark, Flink, and SQL. There are other specialized frameworks available, such as Facebook Prophet for time-series data or Feature Tools for automated feature engineering.
Below is an example of feature logic in Python for creating a feature that represents the number of words in a text document:
In this example, the word_count_feature function takes a column of text data as input, splits the text into words, and returns a count of the number of words in each document. The resulting feature values are then added to the original dataset as a new column. Later, you could write those values as part of a Pandas DataFrame to a feature group.