> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/more-details/digital-twin/simulation-types/prediction.md).

# Prediction

Prediction takes a [Digital Twin](/more-details/digital-twin.md) and an input scenario, and returns the most likely value of a target variable with a confidence interval.

For the workflow that produces a Digital Twin in the first place, see [Step 5: Build Digital Twin](/user-guide/creating-digital-twin.md).

***

## Why a Digital Twin prediction beats an LLM prediction

A prediction from a Digital Twin gives you three things an LLM cannot.

1. **Repeatable.** The same input always produces the same output.
2. **Explainable.** The prediction comes from a DAG — a system of equations whose causal logic can be inspected end-to-end.
3. **Calibrated.** Every prediction carries a known confidence interval and an understood distribution of outcomes.

A completed Prediction looks like this.

<figure><img src="https://1662811113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXg3gZLR0e2Q8SzeQmql%2Fuploads%2Fgit-blob-2b6ede9ab0c7e376211fe5d3efcc830bc9fe7991%2Frc-prediction-result.png?alt=media" alt="A completed Predict Churn run: a predictions table covering 3 input scenarios at 95% confidence, with Churn predicted as Yes at 60.07% probability for the first case and No at 98.66% for the last"><figcaption><p>A completed Prediction run. The predictions table covers every input scenario, here 3 of them, with 95% confidence intervals.</p></figcaption></figure>

***

## Starting a simulation

Open a Digital Twin from the Digital Twins list, open its **Simulations** row (or click **Run Simulation** in the toolbar), then click **New Simulation**. This opens the [type picker](/more-details/digital-twin/simulation-types.md) — choose **Prediction**.

<figure><img src="https://1662811113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXg3gZLR0e2Q8SzeQmql%2Fuploads%2Fgit-blob-ca79f06c501e06e20db26e754930f6df7f67e9fa%2Frc-simulations-panel.png?alt=media" alt="A Digital Twin&#x27;s simulations: a completed run open in the main view, with the Simulations panel on the right listing recent runs"><figcaption><p>The Simulations panel on the right lists recent runs against the twin; <strong>New Simulation</strong> opens the type picker.</p></figcaption></figure>

***

## Step 1: Choose target variables

Target variables are the outcomes you want to predict. Selecting a target removes it from the input table on the next step — you supply its drivers, not the target itself.

<figure><img src="https://1662811113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXg3gZLR0e2Q8SzeQmql%2Fuploads%2Fgit-blob-d9fa3a6e39d4a4e49871fb06b4a133d03ed08e17%2Frc-prediction-targets.png?alt=media" alt="Step 1 of the Prediction setup: choose target variables, with Churn selected"><figcaption><p>One target is enough; multiple targets run in the same simulation.</p></figcaption></figure>

***

## Step 2: Provide input records

Each row is one scenario. RootCause filters the columns to variables with a causal path to the target.

The form starts empty; you cannot run the simulation until a target is chosen and the required inputs are filled.

<figure><img src="https://1662811113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXg3gZLR0e2Q8SzeQmql%2Fuploads%2Fgit-blob-474f212ed422bd1b280b99bf28397f779c86d7ca%2Frc-prediction-form-empty.jpeg?alt=media" alt="The Prediction setup form, empty: the Choose target variables list with 0 of 19 selected, and the Provide input records step starting below"><figcaption><p>The setup form, empty — no target chosen yet (0 of 19), no input records below.</p></figcaption></figure>

Numeric fields take values directly; categorical fields offer dropdowns. Pick `<MISSING>` for any field you don't have a value for.

<figure><img src="https://1662811113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXg3gZLR0e2Q8SzeQmql%2Fuploads%2Fgit-blob-f07e386fa08ec7bf8e387d4d5b4d4260c649bc0e%2Frc-prediction-form-filled.jpeg?alt=media" alt="The Provide input records step with three filled scenarios, one column per record, below a note reading Showing 7 of 20 variables, only those with a causal path to your selected target are included; 13 variables have no causal influence on the targets and were filtered out"><figcaption><p>Three scenarios filled in, one column per record. The banner above the grid shows the causal filter at work: only the 7 variables with a causal path to the target remain as inputs; the other 13 were filtered out.</p></figcaption></figure>

The tabs above the form offer three other input methods:

* **File Upload** — a CSV (or tab-separated) file with one row per scenario.
* **Dataset** — pull rows directly from a saved dataset. Each dataset also carries a button to score every row on the server instead of loading them into the browser, which is the way to run a prediction over a large one. At most 10,000 rows are read, and the button names the figure when the dataset is bigger than that. The step then names the dataset in place of the input table, with **Enter records instead** to go back.
* **Field Input** *(default)* — the form view shown above.

Rows loaded from a dataset or a source keep their id column even though it is not a variable of the twin, so the result names each record rather than numbering it.

***

## Step 3: Confidence level

The default of 0.95 means the model is 95% confident the actual value falls within the shown range. Higher confidence widens the interval; lower narrows it. Leave the default unless you have a specific reason to change it.

***

## Reading the result

Clicking **Run Simulation** opens the result page: the run's title and status pills, then the predictions table — the run shown at the top of this page. The run's configuration is shown under its row in the run list. The table gives each input scenario, the predicted class or value, and the confidence interval, and exports as CSV or JSON from its own button. For a PDF, tick the run in the list, click **Export 1 as report**, and use **Export PDF** in the report editor.

***

## Who's at risk

A run with a categorical target opens with **Who's at risk** above the predictions table: every record ranked by the model's chance of one value, lowest first, so the records in most trouble come first. Where the run predicted more than one categorical target, a picker chooses which one ranks the list, and a second control chooses the value — *Churn = No*, *Approved = Yes* — whose chance is read.

**At risk below** is the line, a slider running from 50% up to 95% and starting at 50%, the model's own line between outcomes. A histogram under it shows how the records are spread across the range, and a sentence counts how many fall below the line.

Each row names the record by its id column, with its position in the run beside it, then its chance of the chosen value, the value the model predicts for it, and up to four of the target's direct causes for context. Records below the line start ticked; the checkboxes adjust the selection, **Select the&#x20;*****N*****&#x20;below the line** restores it, and **Clear selection** empties it. Moving the slider re-selects everything below the new line.

**Find best actions for&#x20;*****N*****&#x20;records** hands the ticked records to [Best Action](/more-details/digital-twin/simulation-types/best-action.md) as a new run, already set to the same target and value, and titled after them — "Best actions for 21 records below 50% Churn = No". A line raised above 50% comes along as the target's success line, so the solver has to get each record over the same bar. A single run takes at most 500 records; tick more and the 500 most at risk are the ones carried over. The records travel as a reference to this prediction rather than as copied values, so the Best Action run names this run as its parent in the twin's lineage bar.

***

## Past simulations

The Simulations panel lists every run against the twin, with a search field and a **Filter** button. Runs triggered by an Application are listed too, marked with an **App** badge; set the filter's **Ran by** to Apps or People to narrow to one or the other. Whenever a search or a filter is holding runs back, the panel header says so — `1 of 2 · 1 hidden` — and a **Show all** button beside it clears the search and the filters in one click. The **Simulations** row on the twin's Home opens the same list.

<figure><img src="https://1662811113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXg3gZLR0e2Q8SzeQmql%2Fuploads%2Fgit-blob-40a3c02e424ee72ce2c5e0e59ec5d7bc0b4aaef7%2Frc-simulations-view-all.png?alt=media" alt="The New Simulation screen with the Simulations panel on the right listing nine completed runs against this twin, each with its status and type, above a search field"><figcaption><p>The Simulations panel lists the runs people started against this twin, here nine completed, with search. Click any entry to reopen its result.</p></figcaption></figure>

***

## Outside the UI

This simulation runs from the Python SDK and from the REST API, with the same configuration the wizard collects.

```python
>>> twin.predict(rows, targets=["Churn"])
```

Over REST it is a scenario on `POST /api/v1/workspaces/{workspaceId}/simulations` with `"type": "prediction"`. Prediction is a static-twin family: a temporal twin projects forward with a [Forecast](/more-details/digital-twin/temporal-simulations/forecast.md) instead. The result carries one row per input record, in the order you sent them. `sampleFrom` predicts a whole dataset on the server rather than sending its rows, and `GET /simulations/{id}/predictions` reads a completed run back as the same ranked worklist the result page shows.

See [Working with Digital Twins](/api-and-integrations/sdk-getting-started/sdk-working-with-twins.md) for the SDK, and [Running Simulations over REST](/api-and-integrations/rest-running-simulations.md) for the request body.

***

## Other Simulation Types

* [Intervention](/more-details/digital-twin/simulation-types/intervention.md) — change a single variable and observe propagation.
* [Optimization](/more-details/digital-twin/simulation-types/optimization.md) — find the input combination that maximizes or minimizes a target.
* [Best Action](/more-details/digital-twin/simulation-types/best-action.md) — find the minimum change needed to reach a target outcome.
* [Explanation](/more-details/digital-twin/simulation-types/explanation.md) — understand the drivers and impacts behind an outcome.
* [Root Cause Analysis](/more-details/digital-twin/simulation-types/root-cause-analysis.md) — diagnose the cause of a specific abnormal value.
* [Anomaly Scan & Diagnosis](/more-details/digital-twin/simulation-types/anomaly-scan.md) — scan every variable for anomalies and diagnose each one.

See [Step 6: Run Simulations](/user-guide/simulations.md) — general overview.
