Try Something New

View as Markdown

Solution Background and Business Value

Personalized try-something-new recommendations introduce customers to products they have not purchased before but are likely to enjoy based on their buying habits and preferences. This strategy enhances customer experience by encouraging product discovery while expanding sales into new product categories.

By integrating these recommendations into push notifications, in-product placements, and email campaigns, businesses can:

  • Drive cross-selling opportunities by exposing customers to new product lines.

  • Enhance customer satisfaction by keeping the shopping experience fresh.

  • Increase engagement and retention by offering relevant and timely suggestions.

Data Requirements and Graph Schema

Building an effective Try-Something-New recommendation model requires a structured dataset. A small set of core tables is sufficient to start; adding more data sources can improve model quality.

Core Tables

Three core tables are required:

  1. Users Table

    • Stores details about users for whom the model generates recommendations.

    • Key attributes:

      • user_id: Unique identifier (Primary Key).

      • join_timestamp: When the user joined.

      • Other optional features: age, location, and shopping behavior.

  2. Items Table

    • Stores information about the items available for recommendation.

    • Key attributes:

      • item_id: Unique identifier (Primary Key).

      • start_timestamp / end_timestamp: Availability period of the item.

      • Other optional features: price, category, color, and brand.

  3. Transactions Table

    • Stores user purchase history, which the model learns from.

    • Key attributes:

      • transaction_id: Unique identifier (Primary Key).

      • user_id: Foreign Key linking to Users.

      • item_id: Foreign Key linking to Items.

      • timestamp: When the purchase was made.

      • Other optional features: total amount, payment method, and discount applied.

Entity Relationship Diagram (ERD)

Predictive Query

The challenge in try-something-new recommendations is keeping recommendations novel to the user without discarding valuable purchase history. Training a model solely on first-time purchases would lose the broader patterns that drive good recommendations.

Instead, train a general item-to-user recommendation model and apply filters at prediction time to remove items the user has already purchased. This ensures:

  • The model learns broad user-item affinity.

  • Users receive only new product recommendations.

PREDICT LIST_DISTINCT(transactions.item_id, 0, X, days) RANK TOP 50
FOR EACH users.user_id

This query:

  • Predicts the top 50 distinct items a user is likely to buy.

  • Uses a future X-day window to determine potential purchases.

Filtering for New Recommendations

Try-something-new recommendations work best for less-active users. Target those with fewer than N purchases in the last D days by adding the following filter:

WHERE COUNT(transactions.*, -D, 0, days) < N

Building models in Kumo Fine-Tune SDK

The Kumo Fine-Tune SDK simplifies ML modeling on relational data and implements this solution in a few steps.

1. Initialize the Kumo Fine-Tune SDK

1import kumoai as kumo
2
3kumo.init(url="https://<customer_id>.kumoai.cloud/api", api_key=API_KEY)

2. Connect data

1connector = kumo.S3Connector("s3://your-dataset-location/")

3. Select tables

1users = kumo.Table.from_source_table(
2 source_table=connector.table('users'),
3 primary_key='user_id',
4).infer_metadata()
5
6items = kumo.Table.from_source_table(
7 source_table=connector.table('items'),
8 primary_key='item_id',
9).infer_metadata()
10
11transactions = kumo.Table.from_source_table(
12 source_table=connector.table('transactions'),
13 time_column='timestamp',
14).infer_metadata()

4. Create graph schema

1graph = kumo.Graph(
2 tables={
3 'users': users,
4 'items': items,
5 'transactions': transactions,
6 },
7 edges=[
8 dict(src_table='transactions', fkey='user_id', dst_table='users'),
9 dict(src_table='transactions', fkey='item_id', dst_table='items'),
10 ],
11)
12
13graph.validate(verbose=True)

5. Train the model

1pquery = kumo.PredictiveQuery(
2 graph=graph,
3 query=(
4 "PREDICT LIST_DISTINCT(transactions.item_id, 0, X, days) RANK TOP 50\n"
5 "FOR EACH users.user_id"
6 ),
7)
8pquery.validate(verbose=True)
9
10model_plan = pquery.suggest_model_plan()
11trainer = kumo.Trainer(model_plan)
12training_job = trainer.fit(
13 graph=graph,
14 train_table=pquery.generate_training_table(non_blocking=True),
15 non_blocking=False,
16)
17print(f"Training metrics: {training_job.metrics()}")

6. Run the model

1prediction_job = trainer.predict(
2 graph=graph,
3 prediction_table=pquery.generate_prediction_table(non_blocking=True),
4 output_types={'predictions', 'embeddings'},
5 output_connector=connector,
6 output_table_name='try_something_new_predictions',
7 training_job_id=training_job.job_id,
8 non_blocking=False,
9)
10print(f'Batch prediction job summary: {prediction_job.summary()}')