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:

DESCRIBE model_name;

Or:

DESCRIBE MODEL model_name;

This command is similar to the below command:

SELECT *
FROM models
WHERE name = 'model_name';

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.

DESCRIBE [MODEL] home_rentals_model;

On execution we get:

+--------------------------------------+--------------------+-----------+---------+--------+---------+----------+----------+--------------+---------------+-----------------+--------+--------------------------------------+----------------------------+--------+
| tables                               | NAME               | ENGINE    | PROJECT | ACTIVE | VERSION | STATUS   | ACCURACY | PREDICT      | UPDATE_STATUS | MINDSDB_VERSION | ERROR  | SELECT_DATA_QUERY                    | TRAINING_OPTIONS           | TAG    |
+--------------------------------------+--------------------+-----------+---------+--------+---------+----------+----------+--------------+---------------+-----------------+--------+--------------------------------------+----------------------------+--------+
| ["info","features","model","jsonai"] | home_rentals_model | lightwood | mindsdb | true   | 1       | complete | 0.999    | rental_price | up_to_date    | 23.4.4.0        | [NULL] | SELECT * FROM demo_data.home_rentals | {'target': 'rental_price'} | [NULL] |
+--------------------------------------+--------------------+-----------+---------+--------+---------+----------+----------+--------------+---------------+-----------------+--------+--------------------------------------+----------------------------+--------+

The tables output column lists all available options to describe a model.

DESCRIBE [MODEL] home_rentals_model.info;

The above command returns the following output columns:

NameDescription
accuraciesIt lists the accuracy function used to evaluate the model and the achieved score.
column_importancesIt lists all feature-type columns and assigns importance values.
outputsThe target column.
inputsAll the feature columns.

NLP Models

MindsDB offers NLP models that utilize either Hugging Face or OpenAI engines. Let’s see how to describe such models.

DESCRIBE [MODEL] sentiment_classifier;

On execution we get:

+---------------------+----------------------+--------+---------+--------+---------+----------+----------+-----------+---------------+-----------------+--------+-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+
| tables              | NAME                 | ENGINE | PROJECT | ACTIVE | VERSION | STATUS   | ACCURACY | PREDICT   | UPDATE_STATUS | MINDSDB_VERSION | ERROR  | SELECT_DATA_QUERY | TRAINING_OPTIONS                                                                                                                                                                                                                                                                                              | TAG    |
+---------------------+----------------------+--------+---------+--------+---------+----------+----------+-----------+---------------+-----------------+--------+-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+
| ["args","metadata"] | sentiment_classifier | openai | mindsdb | true   | 1       | complete | [NULL]   | sentiment | up_to_date    | 23.1.3.2        | [NULL] | [NULL]            | {'target': 'sentiment', 'using': {'prompt_template': 'describe the sentiment of the reviews\n                     strictly as "positive", "neutral", or "negative".\n                     "I love the product":positive\n                     "It is a scam":negative\n                     "{{review}}.":'}} | [NULL] |
+---------------------+----------------------+--------+---------+--------+---------+----------+----------+-----------+---------------+-----------------+--------+-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+

The tables output column lists all available options to describe a model.

DESCRIBE [MODEL] sentiment_classifier.args;

The above command returns the following output columns:

NameDescription
keyIt stores parameters, such as prompt_template and target.
valueIt 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.

DESCRIBE [MODEL] quarterly_expenditure_forecaster;

On execution we get:

+-----------------------------+----------------------------------+---------------+---------+--------+---------+----------+----------+-------------+---------------+-----------------+--------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+--------+
| tables                      | NAME                             | ENGINE        | PROJECT | ACTIVE | VERSION | STATUS   | ACCURACY | PREDICT     | UPDATE_STATUS | MINDSDB_VERSION | ERROR  | SELECT_DATA_QUERY                     | TRAINING_OPTIONS                                                                                                                                    | TAG    |
+-----------------------------+----------------------------------+---------------+---------+--------+---------+----------+----------+-------------+---------------+-----------------+--------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+--------+
| ["info","features","model"] | quarterly_expenditure_forecaster | statsforecast | mindsdb | true   | 1       | complete | [NULL]   | expenditure | up_to_date    | 23.4.4.0        | [NULL] | SELECT * FROM historical_expenditures | {'target': 'expenditure', 'using': {}, 'timeseries_settings': {'is_timeseries': True, 'order_by': 'month', 'horizon': 3, 'group_by': ['category']}} | [NULL] |
+-----------------------------+----------------------------------+---------------+---------+--------+---------+----------+----------+-------------+---------------+-----------------+--------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+--------+

The tables output column lists all available options to describe a model.

DESCRIBE [MODEL] quarterly_expenditure_forecaster.info;

The above command returns the following output columns:

NameDescription
accuraciesIt lists the chosen model name and its accuracy score.
outputsThe target column.
inputsAll the feature columns.

Other Models

Models that utlize LangChain or are brought to MindsDB via MLflow can be described as follows:

DESCRIBE [MODEL] other_model;

The above command returs ["info"] in its first output column.

DESCRIBE [MODEL] other_model.info;

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.