MSE

Returns a table that displays the mean squared error of the prediction and response columns in a linear regression model.

You cannot pass any inputs to the OVER() clause.

Important: Before using a machine learning function, be aware that all the ongoing transactions might be committed.

Syntax

MSE ( target, prediction)
     OVER()

Parameters

target

The response variable for the model. Must be a float.

prediction

The output from the PREDICT_LINEAR_REG function. If that output is saved as a table, the column containing the prediction from the function is used. Must be a float.

Examples

This example shows how you can execute the MSE function on an input table named faithful_testing. The response variables appear in the column obs, while the prediction variables appear in the column pred.

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