Predictions
Get a Single Prediction
Description
The db.model_name.find()
function fetches predictions from the model table. The data is returned on the fly and the result set is not persisted. If you want to save your predictions, you can utilize a view or a table.
Syntax
Here is the syntax for making a single prediction:
On execution, we get:
Where:
Expressions | Description |
---|---|
"target_name_original" | The real value of the target variable from the collection. |
"target_name_confidence" | Model confidence. |
"target_name_explain" | JSON object that contains additional information, such as predicted_value , confidence , anomaly , truth , confidence_lower_bound , confidence_upper_bound . |
"target_name_anomaly" | Model anomaly. |
"target_name_min" | Lower bound value. |
"target_name_max" | Upper bound value. |
Example
The following MQL statement fetches the predicted value of the rental_price
column from the home_rentals_model
model. The predicted value is the rental
price of a property with attributes listed as a parameter to the find()
method.
On execution, we get: