> ## Documentation Index
> Fetch the complete documentation index at: https://docs.truestate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Build your first predictive model

> Define a prediction, prepare suitable data, and turn training into a repeatable workflow.

Dawn can help you build and run modelling pipelines. Your most important input is a clear definition of what to predict, when the prediction will be made, and how you will decide whether it is useful.

## Choose a modelling task

| Task                      | Example                                    | Typical approach                                                              |
| ------------------------- | ------------------------------------------ | ----------------------------------------------------------------------------- |
| Classification            | Which customers are likely to stop buying? | Predict a category or its probability.                                        |
| Regression                | What will an order's delivery time be?     | Predict a numeric value.                                                      |
| Clustering                | Which customers have similar behaviour?    | Group similar records without a target label.                                 |
| Time-dependent prediction | What will demand be next month?            | Prepare time-aware features and validation; consider a suitable custom model. |

Start with a straightforward baseline before a more complex model. A complex model is useful only if its measured performance and operating cost justify it.

## 1. Define the prediction

For a customer churn example, specify the observation date, what counts as churn, and the future period in which churn is measured. Decide how each prediction will be used.

```text theme={null}
Help me design a customer churn model. We want to predict at the end of each
month which customers will make no purchase in the next 60 days. Define the
training row, target, eligible population, and information available at the
prediction date. Identify missing data before building anything.
```

**Expected result:** a prediction definition you can explain without referring to a particular algorithm.

## 2. Prepare the training data

Use a [data engineering pipeline](/guides/data-engineering) to produce one row per training example. Include the target and features available at prediction time.

Exclude information from the future, such as cancellation outcomes that occur after the observation date. This is data leakage: it can make test results look strong while producing poor predictions in use.

Check missing values, repeated entities, class balance, and the period covered. Keep an identifier for reconciling predictions, but assess whether it should be a model feature.

## 3. Agree on a validation design

Ask Dawn to explain the split before training. Random splitting can be inappropriate for time-based predictions or repeated records from the same customer.

For a future-facing prediction, consider training on earlier periods and evaluating on later ones. If records for the same entity must stay together, make that requirement explicit in the data preparation. Do not assume a default split enforces time or entity boundaries.

## 4. Build and review the training pipeline

Attach the prepared dataset and ask for a suitable classification or regression training step, a named model output, and evaluation outputs.

```text theme={null}
Build a baseline classification pipeline for this prepared dataset. Show the
feature columns, target, split approach, algorithm, and evaluation metrics.
Exclude identifiers and any fields unavailable at prediction time. Let me
review the configuration before running training.
```

Dawn provides tabular modelling steps and custom Python model workflows. Start with a supported tabular training step unless your problem needs custom code. Open the training step and inspect **Input Features** and **Target Column** in its Configuration. Review **Advanced Settings** where needed. Check the selected features rather than accepting every column as an input.

## 5. Train and evaluate

Run the pipeline. Inspect the model output, training logs, and evaluation results. Compare performance with a simple baseline and review errors in groups that matter to your use case.

For classification, inspect precision and recall at the threshold you intend to use. For regression, inspect error size in the target's units and compare it with the business tolerance. See [evaluating and using models](/data-science/evaluation).

## 6. Generate predictions

Add an inference step using the trained model and a prepared dataset of records to score. Match the training features and types. Inspect the actual output columns and join predictions back to their source identifiers.

Start with batch predictions into a dataset. Add a dashboard or report once you understand the result. For API-based serving, confirm the model's supported deployment workflow and test its input contract before integrating a consuming application.

## Maintain the model

Record the training period, target definition, feature logic, model version, and evaluation results. Re-evaluate as new outcomes become available or source data changes. Retraining is a separate operation from refreshing predictions with an existing model.
