Ngchiwa Ng
1 min readFeb 22, 2020

numpy MAE and MSE

import numpy as np
y = 10
yp = 1
np.abs(y - yp).mean() #9
import numpy as np#MSE = np.square(y - yp).mean()#number
y = 100
yp = 10
mse = np.square(y - yp).mean() #8100.0
#array number
y = np.array([100,100])
yp = np.array([10, 10])
mse = np.square(y - yp).mean() #8100.0

more numpy usage:

https://www.hrwhisper.me/learning-notes-for-python-numpy/

Ngchiwa Ng
Ngchiwa Ng

Written by Ngchiwa Ng

Backend/iOS Engineer, rock the world

No responses yet