Skip to main content

Quickstart

Predict 90-day churn for every customer, as of July 1.

With pandas, the schema is inferred from your frames (PKs from *_id naming, time columns from datetime dtypes):

import pandas as pd
import relativedb

ds = relativedb.from_dataframes(
{"customers": customers, "products": products, "orders": orders},
links=[("orders", "customer_id", "customers"),
("orders", "product_id", "products")])

df = ds.predict(
"PREDICT COUNT(orders.*, 0, 90, days) = 0 FOR EACH customers.customer_id",
anchor_time=pd.Timestamp("2026-07-01"))
print(df) # entity_id, probability — one row per customer

:::info No model required By default predictions come from a transparent, model-free history baseline — the full pipeline runs with zero model artifacts. Swap in the real RT-J model via the native backend. :::

Next steps