Least Squared Error


Difficulty: 1 | Problem written by Junaid Ahmed
Lease Squaared Error (LSE) works by reducing the total square of the errors to the smallest possible value (hence the name "least squares"). The number of squared errors is minimized by using a straight line. These errors are mostly used in linear regression.

The equation for LSE is:

\(L = \frac{1}{2}(y-z)^{2} \)

y is the real value 

z is the predicted value

Write a Python function to compute the LSE of the predicted and real values.

Use different inputs to check the validity of the program.

Sample Input:
<class 'list'>
y: 0.34
z: 0.56

Expected Output:
<class 'float'>

Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)