# How to build predictive models on DataNature: from lakehouse data to production predictions

> Yes, DataNature includes everything needed to build prediction models. Data lands in Iceberg tables, dbt builds clean Silver and Gold data, the feature store holds reusable features, Spark trains models with experiment tracking, the model registry versions and approves them, and model serving delivers batch or real-time predictions. Predictions flow into AI360 Studio for decisions and into Voir agents as skills, and DataNature Atlas records lineage, access and every prediction served, all inside your jurisdiction.

Source: https://datanature.ai/blog/build-predictive-models-on-datanature-guide
Publisher: Dlytica Inc. (DataNature is a Dlytica company)
Updated: 2026-11-05

Predictions are where data turns into action: which customer will leave, which loan will default, which machine will fail, how much stock to order. DataNature gives data science teams one governed platform to build those models and put them to work, without copying data to an outside ML service. This guide walks through the full path.

## What does DataNature provide for prediction models?

| Step | DataNature capability | What it does |
|---|---|---|
| Data | [Lakehouse](/platform/lakehouse), [Connect](/platform/connect), [StreamHouse](/platform/streamhouse) | Brings source data into open Iceberg tables, batch and real time |
| Preparation | [Data Engineering](/platform/data-engineering) (dbt on Spark or Trino) | Cleans and models data into Silver and Gold tables |
| Features | Feature store in [DataNature AI](/platform/ai) | Defines reusable, versioned features once for training and serving |
| Training | Spark compute and notebooks with experiment tracking | Trains and compares models, logging parameters, metrics and artifacts |
| Registry | Model registry | Versions models, records the data snapshot used, and gates promotion with approvals |
| Serving | Batch scoring jobs and real-time endpoints | Writes predictions to Gold tables or answers API calls in milliseconds |
| Monitoring | Evaluation and drift monitoring | Tracks accuracy, data drift and prediction volume over time |
| Action | [AI360 Studio](/products/ai360-studio), [Voir](/products/voir), reverse ETL | Turns predictions into segments, next-best actions, agent skills and CRM updates |
| Governance | [DataNature Atlas](/platform/atlas) | Applies access rules, masks personal data and records lineage from source to prediction |

## Who builds the models?

- **Data scientists** use notebooks, Spark and familiar Python libraries such as scikit-learn, XGBoost, LightGBM and PyTorch, with experiment tracking and the model registry.
- **Analysts and business teams** use AI360 Studio's prebuilt models for churn, propensity, cross-sell, credit risk and fraud, configured on governed data without writing code.
- **Data engineers** own the pipelines and features that both rely on.

## How does a project run, step by step?

### 1. Frame the prediction

Write down what you predict, for whom, how far ahead, and what action follows. For example: "the probability that a retail customer closes their account in the next 90 days, so relationship managers can call the top 5% each week." The action decides the metric you optimize.

### 2. Build the training table

Join Gold tables into one row per entity per point in time, with the label taken from the future window. Use point-in-time joins so features only use data available at the prediction date; this avoids leakage, the most common reason models fail in production.

```sql
-- One row per customer per month-end, label = closed in the next 90 days
select c.customer_key,
       c.snapshot_date,
       f.balance_avg_90d, f.txn_count_30d, f.complaints_180d, f.products_held,
       case when cl.closed_date between c.snapshot_date and c.snapshot_date + interval '90' day
            then 1 else 0 end as label
from gold.customer_snapshots c
join features.customer_monthly f
  on f.customer_key = c.customer_key and f.as_of_date = c.snapshot_date
left join gold.account_closures cl on cl.customer_key = c.customer_key
where c.snapshot_date between date '2024-01-31' and date '2026-06-30'
```

### 3. Define features once

Register features such as `balance_avg_90d` or `txn_count_30d` in the feature store with their owner, definition and refresh schedule. The same definitions feed training and serving, so the model sees the same numbers in production as it did in training.

### 4. Train and track experiments

Train on Spark or in a notebook, and log every run: parameters, metrics, feature list, training data snapshot and the model file. Compare runs side by side and keep the evidence for reviewers.

```python
from lightgbm import LGBMClassifier
from sklearn.metrics import roc_auc_score

train = spark.table("ml.churn_training").filter("snapshot_date < '2026-01-01'").toPandas()
test  = spark.table("ml.churn_training").filter("snapshot_date >= '2026-01-01'").toPandas()
X_cols = ["balance_avg_90d", "txn_count_30d", "complaints_180d", "products_held"]

model = LGBMClassifier(n_estimators=400, learning_rate=0.05, num_leaves=31)
model.fit(train[X_cols], train["label"])
auc = roc_auc_score(test["label"], model.predict_proba(test[X_cols])[:, 1])
# Log parameters, the AUC, the feature list and the model artifact to experiment tracking,
# then register the best run in the model registry for review.
```

Split by time, not at random, so the test set looks like the future the model will face.

### 5. Validate and approve

Before promotion, check accuracy on recent data, calibration, stability across segments and, for decisions about people, fairness across groups. Record the review and approval in the model registry. Regulated teams map this to model risk rules such as OSFI E-23 or SR 11-7.

### 6. Deploy

- **Batch**: a scheduled job in [Jobs and Pipelines](/platform/jobs-and-pipelines) scores all customers and writes predictions to a Gold table with the model version.
- **Real time**: a model endpoint scores single requests, using fresh features from StreamHouse and Lakebase, for cases such as fraud or in-session offers.

### 7. Act on predictions

Predictions become useful when they change what people do:

- AI360 Studio turns scores into segments and next-best actions, and syncs them to CRM and campaign tools.
- Voir agents call models as skills, for example to explain why a customer is at risk.
- Dashboards in BI show predictions next to outcomes.

### 8. Monitor and retrain

Track prediction drift, feature drift and actual outcomes. Set alerts when accuracy drops, retrain on a schedule or when drift appears, and compare the new model with the current one before switching.

## What solutions can you build this way?

| Solution | Prediction | Guide or use case |
|---|---|---|
| Customer churn | Probability of leaving in a time window | [Build a churn prediction model](/blog/build-churn-prediction-model-datanature) |
| Credit risk | Probability of default, with reasons | [Build an explainable credit risk model](/blog/build-explainable-credit-risk-model-datanature) |
| Demand and capacity | Future volumes by product, store or cell | [Forecasting on DataNature](/blog/demand-forecasting-on-datanature-lakehouse) |
| Fraud | Risk score per transaction or claim | [Real-time fraud detection on a lakehouse](/blog/how-to-build-real-time-fraud-detection-on-a-lakehouse) |
| Predictive maintenance | Probability of failure per asset | [Predictive maintenance use case](/use-cases/predictive-maintenance-manufacturing) |
| Next best product | Propensity per product | [Next-best offer use case](/use-cases/cross-sell-and-next-best-offer-banking) |

## How is it governed?

Every feature, model and endpoint is registered, and Atlas lineage traces each prediction back through the model version and training snapshot to source tables. Personal data is masked by role during exploration, access to training data is logged, and predictions served are recorded. See [MLOps and LLMOps on DataNature](/blog/mlops-llmops-model-registry-tracing-evaluation).

## Frequently asked questions

### Can we use our own Python libraries?

Yes. Notebooks and Spark jobs run standard Python libraries; your platform team controls which packages are approved.

### Do we need GPUs?

Not for most tabular prediction models, which train well on CPUs. GPUs are available where your deployment provides them, for deep learning and large language models.

### Can business users build models without code?

Yes, for common cases. AI360 Studio provides prebuilt churn, propensity, cross-sell, credit risk and fraud models that run on your governed data.

## Sources

- [DataNature AI](/platform/ai)
- [DataNature: MLOps and LLMOps](/blog/mlops-llmops-model-registry-tracing-evaluation)
- [DataNature: dbt on Spark and Trino with Iceberg](/blog/dbt-spark-trino-iceberg-medallion-pipelines)

## How does DataNature Atlas keep this secure and compliant?

Agents are governed like users: scoped, masked, logged and unable to act without approval. [DataNature Atlas](/platform/atlas) is the platform's governance module:

- **Knows your data**: a catalog with automated PII detection and classification across Bronze, Silver and Gold.
- **Controls access**: role-based grants plus attribute-based policies, row filters and column masks (null, redact, partial, hash, year only).
- **Governs AI**: Voir agents are scoped principals; masks, row filters and PII guardrails apply to every tool call and answer.
- **Proves it**: lineage from source to metric to decision, and an audit log of who or what accessed which data.
- **Stays local**: Atlas runs inside your deployment, so policies, lineage and logs never leave your jurisdiction.

These controls support GDPR, PIPEDA, Quebec Law 25, CCPA, HIPAA and sector rules such as OSFI E-23. Read [DataNature Atlas in depth](/blog/datanature-atlas-governance-rbac-abac-pii-masking) or see [security and compliance](/security).
