1from sklearn.metrics import mean_squared_error
2mean_squared_error(y_true, y_pred)
1from sklearn.metrics import mean_squared_error
2
3# Given values
4Y_true = [1,1,2,2,4] # Y_true = Y (original values)
5
6# calculated values
7Y_pred = [0.6,1.29,1.99,2.69,3.4] # Y_pred = Y'
8
9# Calculation of Mean Squared Error (MSE)
10mean_squared_error(Y_true,Y_pred)
11