MSE

返回一个表,其中显示机器学习模型中预测和响应列的均方误差。

语法

MSE ( targets, predictions ) OVER()

参数

targets
FLOAT 类型的模型响应变量。
predictions
包含响应变量预测值的 FLOAT 输入列。

示例

对输入表 faithful_testing 执行 MSE 函数。obs 列中显示响应变量,而 prediction 列中显示预测值。

=> SELECT MSE(obs, prediction) OVER()
   FROM (SELECT eruptions AS obs,
                PREDICT_LINEAR_REG (waiting USING PARAMETERS model_name='myLinearRegModel') AS prediction
         FROM faithful_testing) AS prediction_output;
        mse        |                   Comments
-------------------+-----------------------------------------------
 0.252925741352641 | Of 110 rows, 110 were used and 0 were ignored
(1 row)