Join Models with Tables
Description
The JOIN
clause combines rows from the database table and the model table on a column defined in its implementation. It is used to make batch predictions, as shown in the examples.
Syntax
Here is the syntax that lets you join multiple data tables with multiple models to get all predictions at once.
Where:
Name | Description |
---|---|
integration_name.table_name_1 | Name of the data source table used as input for making predictions. |
integration_name.table_name_2 | Optionally, you can join arbitrary number of data source tables. |
project_name.model_name_1 | Name of the model table used to make predictions. |
project_name.model_name_2 | Optionally, you can join arbitrary number of models. |
Mapping input data to model arguments
If the input data contains a column named question
and the model requires an argument named input
, you can map these columns, as explained below.
We have a model that expects to receive input
:
We have an input data table that has the following columns:
Now if you want to get answers to these questions using the model, you need to join the input data table with the model and map the question
column onto the input
argument.
Example 1
Let’s join the home_rentals
table with the home_rentals_model
model using this statement:
On execution, we get:
Example 2
Let’s query a time series model using this statement:
On execution, we get:
Follow this doc page to see examples of joining multiple data table with multiple models.
Was this page helpful?