I am trying to create a function that will calculate mean squared error from y (true values) and y_pred (predicted ones) not using sklearn or other implementations.
I'll try next:
def mserror(y, y_pred):
for i in range (len(y)):
mse = ((y - y_pred) ** 2).mean(y)
How to fix it?