The describe command is used to display the attributes of an existing model. It accepts the name of the model and describe attribute separated by ’.’ as an argument.

Here is how to call the describe command:

db.runCommand({describe: "predictor_name.attribute"})

Where:

NameDescription
predictor_nameThe name of the predictor whose statistics you want to see.
attributeThe argument of the describe command defines the type of statistics (features, or model, or ensemble).

The describe Command with the features Parameter

Description

The db.runCommand({describe: "predictor_name.features"}) command is used to display the way the model encoded the data before training.

Syntax

Here is the syntax:

db.runCommand({describe: "predictor_name.features"})

On execution, we get:

{
  "data": [
    {
      "column": "number_of_rooms",
      "type": "categorical",
      "encoder": "OneHotEncoder",
      "role": "feature"
    }
  ]
}

Where:

NameDescription
"column"The name of the column.
"type"Type of the inferred data.
"encoder"Encoder used.
"role"Role of the column (feature or target).

Example

Let’s describe the home_rentals_model model.

db.runCommand({describe: "home_rentals_model.features"})

On execution, we get:

{
  "data": [
    {
      "column": "number_of_rooms",
      "type": "categorical",
      "encoder": "OneHotEncoder",
      "role": "feature"
    },
    {
      "column": "number_of_bathrooms",
      "type": "binary",
      "encoder": "BinaryEncoder",
      "role": "feature"
    },
    {
      "column": "sqft",
      "type": "float",
      "encoder": "NumericEncoder",
      "role": "feature"
    },
    {
      "column": "location",
      "type": "categorical",
      "encoder": "OneHotEncoder",
      "role": "feature"
    },
    {
      "column": "days_on_market",
      "type": "integer",
      "encoder": "NumericEncoder",
      "role": "feature"
    },
    {
      "column": "initial_price",
      "type": "integer",
      "encoder": "NumericEncoder",
      "role": "feature"
    },
    {
      "column": "neighborhood",
      "type": "categorical",
      "encoder": "OneHotEncoder",
      "role": "feature"
    },
    {
      "column": "rental_price",
      "type": "float",
      "encoder": "NumericEncoder",
      "role": "target"
    }
  ],
  "ns": "mindsdb.home_rentals_model"
}

The describe Command with the model Parameter

Description

The db.runCommand({describe: "predictor_name.model"}) method is used to display the performance of the candidate models.

Syntax

Here is the syntax:

db.runCommand({describe: "predictor_name.model"})

On execution, we get:

{
  "data": [
    {
       "name" : "candidate_model",
       "performance" : <0.0|1.0>,
       "training_time" : <seconds>,
       "selected" : <0|1>
    }
  ]
}

Where:

NameDescription
"name"Name of the candidate model.
"performance"Accuracy 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.

Example

Let’s see the output for the home_rentals_model model.

db.runCommand({describe: "home_rentals_model.model"})

On execution, we get:

{
  "data": [
    {
      "name": "Neural",
      "performance": 0.999,
      "training_time": 48.37,
      "selected": 0
    },
    {
      "name": "LightGBM",
      "performance": 1,
      "training_time": 33,
      "selected": 1
    },
    {
      "name": "Regression",
      "performance": 0.999,
      "training_time": 0.05,
      "selected": 0
    }
  ],
  "ns": "mindsdb.home_rentals_model"
}

The describe Command with the ensemble Parameter

Description

The db.runCommand({describe: "predictor_name.ensemble"}) command is used to display the parameters used to select the best candidate model.

Syntax

Here is the syntax:

db.runCommand({describe: "predictor_name.ensemble"})

On execution, we get:

+-----------------+
| ensemble        |
+-----------------+
| {JSON}          |
+-----------------+

Where:

NameDescription
ensembleObject of the JSON type describing the parameters used to select the best candidate model.