Describe a Model
The stats()
method is used to display the attributes of an existing model. It accepts the {scale: "attribute"}
object as an argument.
Here is how to call the stats()
method:
Where:
Name | Description |
---|---|
predictor_name | The name of the predictor whose statistics you want to see. |
{scale: "attribute"} | The argument of the stats() method defines the type of statistics ({scale: "features"} , or {scale: "model"} , or {scale: "ensemble"} ). |
The stats()
Method with the {scale: "features"}
Parameter
Description
The db.predictor_name.stats({scale: "features"})
method is used to display the
way the model encoded the data before training.
Syntax
Here is the syntax:
On execution, we get:
Where:
Name | Description |
---|---|
"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.
On execution, we get:
The stats()
Method with the {scale: "model"}
Parameter
Description
The db.predictor_name.stats({scale: "model"})
method is used to display the
performance of the candidate models.
Syntax
Here is the syntax:
On execution, we get:
Where:
Name | Description |
---|---|
"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.
On execution, we get:
The stats()
Method with the {scale: "ensemble"}
Parameter
Description
The db.predictor_name.stats({scale: "ensemble"})
method is used to display the
parameters used to select the best candidate model.
Syntax
Here is the syntax:
On execution, we get:
Where:
Name | Description |
---|---|
ensemble | Object of the JSON type describing the parameters used to select the best candidate model. |