Working with Models
Automate creating, training and running Gretel Models.
Gretel specific Workflow Actions are provided to connect data sources to Gretel Models and Projects.
Training and Serving Models
Action Type | Supported Data Sources | Supported Data Types |
---|---|---|
| Non-relational tabular file(s) | |
| Non-relational tabular file(s), Relational databases, Tabular files containing nested JSON data |
gretel_model
Action Type
gretel_model
Action TypeThe gretel_model
action can be used to train and generate records from Gretel Models. The gretel_model
action does not include support for Gretel Relational and nested JSON data.
Inputs
| The project to create the model in. |
| A reference to a blueprint or config location. If a config location is used, it must be addressable by the workflow action.
This field is mutually exclusive to |
| Specify the model config as a dictionary. Accepts any valid model config.
This field is mutually exclusive to |
| Parameters to run or generate records. If this field is omitted, the model will be trained, but no records will get generated for the model. |
| Data to use for training. This should be a reference to the output from a previous action. |
Outputs
| A dataset object containing the outputs from the models created by this action. |
Example Configs
Train a model from a blueprint without generating any records:
Train and generate records from a model config:
gretel_tabular
Action Type
gretel_tabular
Action TypeThe gretel_tabular
action can be used to train and generate records from Gretel Models. The gretel_tabular
action additionally includes support for Gretel Relational and nested JSON data.
Inputs
| The project to create the model in. |
| (Training details, documented below) |
| Data to use for training, including relationships between tables (if applicable). This should be a reference to the output from a previous action. |
| A reference to a blueprint or config location. If a config location is used, it must be addressable by the workflow action.
This field is mutually exclusive to |
| Specify the model config as a dictionary. Accepts any valid model config.
This field is mutually exclusive to |
| (Run details, documented below) |
| (Synthetics models only.) Parameter for scaling output table size. If set to |
Outputs
| A dataset object containing the outputs from the models created by this action. |
Example Configs
Generate a synthetic database from a blueprint:
Generate a synthetic database from a model config:
Writing Project Artifacts
The write_project_artifact
action can be used to write an action output to a Gretel Project.
Inputs
| The project to create the artifact in. |
| The name of the artifact. |
| Reference to a data handle. |
Outputs
| A dataset with exactly one item (the project artifact) represented as both a file and table. |
Reading Project Artifacts
The read_project_artifact
action can be used to read in existing Gretel Project Artifacts as inputs to other actions.
Inputs
| The project id the artifact is located in. |
| The id of the artifact to read. |
Outputs
| A dataset with exactly one item (the project artifact) represented as both a file and table. |
Examples
Train a Gretel Model from an existing project artifact
Combine two models together using the outputs of one model as the inputs to another
Last updated