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:
| 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
Thedb.predictor_name.stats({scale: "features"}) method is used to display the
way the model encoded the data before training.
Syntax
Here is the syntax:| 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 thehome_rentals_model model.
The stats() Method with the {scale: "model"} Parameter
Description
Thedb.predictor_name.stats({scale: "model"}) method is used to display the
performance of the candidate models.
Syntax
Here is the syntax:| 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 thehome_rentals_model model.
The stats() Method with the {scale: "ensemble"} Parameter
Description
Thedb.predictor_name.stats({scale: "ensemble"}) method is used to display the
parameters used to select the best candidate model.
Syntax
Here is the syntax:| Name | Description |
|---|---|
ensemble | Object of the JSON type describing the parameters used to select the best candidate model. |