Describe a Model
Description
The DESCRIBE
statement is used to display the attributes of an existing model.
The available options to describe a model depend on the underlying engine.
Syntax
Here is how to retrieve general information on the model:
Or:
This command is similar to the below command:
One difference between these two commands is that DESCRIBE
outputs an additional column that stores all available options to describe a model, depending on the underlying engine.
Examples
Lightwood Models
MindsDB uses the Lightwood engine by default. Let’s see how to describe such models.
On execution we get:
The tables
output column lists all available options to describe a model.
The above command returns the following output columns:
Name | Description |
---|---|
accuracies | It lists the accuracy function used to evaluate the model and the achieved score. |
column_importances | It lists all feature-type columns and assigns importance values. |
outputs | The target column. |
inputs | All the feature columns. |
The above command returns the following output columns:
Name | Description |
---|---|
accuracies | It lists the accuracy function used to evaluate the model and the achieved score. |
column_importances | It lists all feature-type columns and assigns importance values. |
outputs | The target column. |
inputs | All the feature columns. |
The above command returns the following output columns:
Name | Description |
---|---|
column | Data columns that were used to create the model. |
type | Data type of the column. |
encoder | Encoder type used for the column. |
role | Role of the column (feature or target ). |
The above command returns the following output columns:
Name | Description |
---|---|
name | Name of the candidate model. |
performance | Accuracy value from 0 to 1, depending on the type of the model. |
training_time | Time elapsed for the training of the model. |
selected | 1 for the best performing model and 0 for the rest. |
accuracy_functions | It defines the accuracy function used to evaluate the model. It stores the r2_score value for regression predictions, the balanced_accuracy_score value for classification predictions, and the bounded_ts_accuracy value for time series predictions. The values vary between 0 and 1, where 1 indicates a perfect predictor, based on results obtained for a held out portion of data. |
The above command returns the following output column:
Name | Description |
---|---|
ensemble | Object of the JSON type describing the parameters used to select the best candidate model. |
NLP Models
MindsDB offers NLP models that utilize either Hugging Face or OpenAI engines. Let’s see how to describe such models.
On execution we get:
The tables
output column lists all available options to describe a model.
The above command returns the following output columns:
Name | Description |
---|---|
key | It stores parameters, such as prompt_template and target . |
value | It stores parameter values. |
The above command returns the following output columns:
Name | Description |
---|---|
key | It stores parameters, such as prompt_template and target . |
value | It stores parameter values. |
The above command returns the following output columns:
Name | Description |
---|---|
key | It stores metadata parameters. |
value | It stores parameter values. |
Nixtla Models
MindsDB integrates Nixtla engines, such as StatsForecast, NeuralForecast, and HierarchicalForecast. Let’s see how to describe models based on Nixtla engines.
On execution we get:
The tables
output column lists all available options to describe a model.
The above command returns the following output columns:
Name | Description |
---|---|
accuracies | It lists the chosen model name and its accuracy score. |
outputs | The target column. |
inputs | All the feature columns. |
The above command returns the following output columns:
Name | Description |
---|---|
accuracies | It lists the chosen model name and its accuracy score. |
outputs | The target column. |
inputs | All the feature columns. |
The above command returns the following output columns:
Name | Description |
---|---|
ds | It defines intervals between records. For example, here, we’ve got monthly expenditure records. |
y | It stores the target column. |
unique_id | It stores columns listed in the GROUP BY clause. It defines the column(s) in the dataset by which you can split it into multiple time series that track the same process or value for different entities or groups. |
The above command returns the following output columns:
Name | Description |
---|---|
model_name | It is the chosen model name. |
frequency | It is the frequency |
season_length | It indicates how many measurements until the next season occurs. For example, a time series with monthly measurements and a season length of 12 means that, every 12 months, a new season occurs. It can have a very strong effect on the final model’s performance. |
hierarchy | It defines whether HierarchicalForecast is used (true ) or not (false ). |
Other Models
Models that utlize LangChain or are brought to MindsDB via MLflow can be described as follows:
The above command returs ["info"]
in its first output column.
The above command lists basic model information.
If you need more information on how to DESCRIBE [MODEL]
or understand the results, feel free to ask us on the community Slack workspace.