General Structure

On start-up, the MindsDB project consists of 2 collections: models and models_versions.

You can verify it by running the following MQL commands:

  1. First, switch to the mindsdb project.

    > use mindsdb
    < 'switched to db mindsdb'
    

    Here is the doc page on the PROJECT entity to learn more.

  2. Then, query for the available collections.

    > show collections
    < models
      models_versions
    

The models Collection

The models collection stores information about the models, such as name, status, accuracy, and more.

> db.models.find({})
< {
    NAME: 'home_rentals_model',
    ENGINE: 'lightwood',
    PROJECT: 'mindsdb',
    VERSION: 1,
    STATUS: 'complete',
    ACCURACY: 1,
    PREDICT: 'rental_price',
    UPDATE_STATUS: 'up_to_date',
    MINDSDB_VERSION: '23.2.4.0',
    ERROR: null,
    SELECT_DATA_QUERY: 'db.home_rentals.find({})',
    TRAINING_OPTIONS: "{'target': 'rental_price', 'using': {}}",
    TAG: null,
    CREATED_AT: 2023-02-24T16:05:43.248Z,
    _id: ObjectId("000000000000007725907968")
  }

Where:

NameDescription
NAMEThe name of the model.
ENGINEThe engine used to create the model.
PROJECTThe project where the model resides.
VERSIONThe version of the model.
STATUSTraining status (generating, or training, or complete, or error).
ACCURACYThe model accuracy (0.999 is a sample accuracy value).
PREDICTThe name of the target column to be predicted.
UPDATE_STATUSTraining update status (up_to_date, or updating, or available).
MINDSDB_VERSIONThe MindsDB version used while training (22.8.2.1 is a sample version value).
ERRORError message stores a value in case of an error, otherwise, it is null.
SELECT_DATA_QUERYIt is a query that selects input data.
TRAINING_OPTIONSAdditional training parameters.
TAGThe models can have tags to classify them into categories.

Check out this doc page to learn how to create, view, and drop models.

The models_versions Collection

The models_versions collection stores information about all present and past versions of each model.

To learn more about managing models’ versions, follow our docs here.

> db.models_versions.find({})
< {
    NAME: 'home_rentals_model',
    ENGINE: 'lightwood',
    PROJECT: 'mindsdb',
    ACTIVE: true,
    VERSION: 1,
    STATUS: 'complete',
    ACCURACY: 1,
    PREDICT: 'rental_price',
    UPDATE_STATUS: 'up_to_date',
    MINDSDB_VERSION: '23.2.4.0',
    ERROR: null,
    SELECT_DATA_QUERY: 'db.home_rentals.find({})',
    TRAINING_OPTIONS: "{'target': 'rental_price', 'using': {}}",
    TAG: null,
    CREATED_AT: 2023-02-24T16:05:43.248Z,
    _id: ObjectId("000000000000007725907969")
  }

Where:

NameDescription
NAMEThe name of the model.
ENGINEThe engine used to create the model.
PROJECTThe project where the model resides.
ACTIVEThe status of the model’s version. The value of true if active, the value fo false if inactive.
VERSIONThe version of the model.
STATUSTraining status (generating, or training, or complete, or error).
ACCURACYThe model accuracy (0.999 is a sample accuracy value).
PREDICTThe name of the target column to be predicted.
UPDATE_STATUSTraining update status (up_to_date, or updating, or available).
MINDSDB_VERSIONThe MindsDB version used while training (22.8.2.1 is a sample version value).
ERRORError message stores a value in case of an error, otherwise, it is null.
SELECT_DATA_QUERYIt is a query that selects input data.
TRAINING_OPTIONSAdditional training parameters.
TAGThe models can have tags to classify them into categories.

Check out this doc page to learn how to work with models’ versions.

To view all databases/projects, use the command below.

> show databases
< admin               64.00 KiB
  information_schema  64.00 KiB
  mindsdb             64.00 KiB
  files               64.00 KiB
  mongo_demo_db       64.00 KiB

Please note that mindsdb is the default project. Here is the doc page on the PROJECT entity to learn more.

Please follow the MindsDB Information Schema doc page to learn more.