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

# PREDICT

`PREDICT(<MODEL>, <TABLE>)`: This operation returns predictions and
confidence scores for each row in `<TABLE>` based on running `<MODEL>`.

This is a table-valued function (TVF). It should be used in a `FROM`
clause. The input model should already exist (see [CREATE MODEL](https://docs.driftodata.com/statements-and-ops/create-model).
The input table should match the columns used to train the input
model (the target column can be ommitted).

### Syntax

```sql
SELECT <COLUMNS> FROM PREDICT(<MODEL>, <TABLE>);
```

### Args

<ParamField query="MODEL" type="model or str (literal)">
  The name of the trained model to use for inference.
</ParamField>

<ParamField query="TABLE" type="table or str (literal)">
  The name of the table over which to compute model predictions.
</ParamField>

### Examples

```sql
CREATE MODEL my_model AS SELECT * FROM train_data;
SELECT * FROM PREDICT(my_model, predict_data);
```
