# Needed packages from sklearn.metrics import mean_squared_error # Values to compare y_true = [3, -0.5, 2, 7] # Observed value y_pred = [2.5, 0.0, 2, 8] # Predicted value # Mean squared error mse = mean_squared_error(y_true, y_pred) print(mse)