I want to compute the mean square error using predicted probabilities and true labels of the data.

MSE = 1/n * sum(y_tru - y_pred)**2

Is there any Python function for the above formula?

MSE = 1/n * sum(y_tru - y_pred)**2

Is there any Python function for the above formula?