# Load the sample transactions data.
data(featForge_transactions)
# Combine the transactions data with extracted keyword features.
trans <- cbind(featForge_transactions,
extract_keyword_features(featForge_transactions$description))
head(trans) # we see that there have been added categories named "casino" and "utilities".
# Aggregate the number of transactions on the application level
# by summing the binary keyword indicators for the 'casino' and
# 'utilities' columns, using a 30-day period.
aggregate_applications(
trans,
id_col = "application_id",
amount_col = "amount",
group_cols = c("casino", "utilities"),
time_col = "transaction_date",
scrape_date_col = "scrape_date",
ops = list(times_different_transactions_in_last_30_days = sum),
period_agg = length,
period = c(30, 1)
)
Run the code above in your browser using DataLab