mean_squared_error¶
In [ ]:
mean_squared_error(y_true: str,
y_score: str,
input_relation: (str, vDataFrame),
root: bool = False)
Computes the mean squared error.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
y_true | str | ❌ | Response column. |
y_score | str | ❌ | Prediction. |
input_relation | str / vDataFrame | ❌ | The relation used for scoring. This relation can be a view, table, or customized relation. For example, you could write: "(SELECT ... FROM ...) x" as long as an alias is given at the end of the relation. |
root | bool | ✓ | If set to True, returns the RMSE (Root Mean Squared Error). |
Returns¶
float : score
Example¶
In [1]:
from verticapy import vDataFrame
vDataFrame("regression_example")
Out[1]:
In [2]:
from verticapy.learn.metrics import mean_squared_error
mean_squared_error("y_true", "y_score", "regression_example")
Out[2]:
In [4]:
# RMSE
mean_squared_error("y_true", "y_score", "regression_example", root = True)
Out[4]:
