Point in Time features can be viewed as features created by applying functions such as the SQL window functions. PIT features are formed through calculations across a set of table rows. Point in Time features uses SQL-like aggregate functions such as MAX, MIN, AVG, etc., aggregate functions but operations are performed across a set of rows to get an output for the row and and every row maintains its state.
Let's see an example to understand how a useful Point in Time feature can be created and used later for training an AI/ML model:
Let's use a new demand forecast focused on store sales data. On the Feature Groups section select the Features option. click on the 'Add' button and select 'Add Point-In-Time Group':
The following configuration window will be opened:
Let's say that we are interested in knowing the number of customers visiting a particular store in the last 10 days. We can create a Point-In-Time Group feature for this purpose by firstly naming our group and then setting 'Store' as our partition key because we are interested in knowing the customer count for each store. Then we need to set the Ordering Key which is mostly a Date or Timestamp.
For History Feature Group, the one attached to the project is selected as Default and we'll use it however we can choose any other feature group in the organization. Finally, we have to select the length of our feature that can be either a window of time or count. In our case, we're interested in the 10 last days so it's going to be a 864000 seconds lookback. If we were interested in last 10 sales for the store, we could have used last 10 rows as lookback. A "lookback window lag" defines how many previous timesteps in seconds or the number of rows are used in the subsequent "lookback window". It's '0' in our case as we aren't interested in adding a lag.
Click "Set Point in time group" to set the PIT feature configuration:
Next, we will need to add the aggregate expression, i.e. SUM(Customers) in our case, to create the PIT feature:
To view the feature, we can go to the 'Materialized Data' and verify the intended behavior. The right-most column, 'customer_visit_10_sum_customers', shows the sum of customers visiting the store in the last 10 days:
You can create multiple PIT features ,or instance, to find an average count of customers visiting the store in last 10 days, all you have to do from here is to add another expression, "avg(Customers)":
Again, you can view the data using "Materialized Data" interface and see the newly created PIT feature: