sum = 4 + 7 + 10 = 21
count = 3
mean = 21 / 3 = 7
LaTeX:
\overline{x} = (\frac{1}{n})\sum_{i=1}^{n}(x_{i})
import numpy values = [4, 7, 10] mean = numpy.average(values) print(mean)
sum = 4 + 7 + 10 = 21
count = 3
mean = 21 / 3 = 7
\overline{x} = (\frac{1}{n})\sum_{i=1}^{n}(x_{i})
import numpy values = [4, 7, 10] mean = numpy.average(values) print(mean)
S1 = [2, 5, 9, 2]
S2 = [6, 3, 6, 1]
D = [2 - 6, 5 - 3, 9 - 6, 2 - 1]
D = [-4, 2, 3, 1]
D = [4, 2, 3, 1]
mae = (4 + 2 + 3 + 1) / 4
mae = 10 / 4
mae = 2.5
mae = (\frac{1}{n})\sum_{i=1}^{n}\left | y_{i} - x_{i} \right |
import sklearn.metrics S1 = [2, 5, 9, 2] S2 = [6, 3, 6, 1] mae = sklearn.metrics.mean_absolute_error(S1, S2) print(mae)
S1 = [2, 5, 9, 2]
S2 = [6, 3, 6, 1]
D = [2 - 6, 5 - 3, 9 - 6, 2 - 1]
D = [-4, 2, 3, 1]
D = [-4 * -4, 2 * 2, 3 * 3, 1 * 1]
D = [16, 4, 9, 1]
mean = (16 + 4 + 9 + 1) / 4
mean = 30 / 4
mean = 7.5
rmse = sqrt(mean)
rmse = 2.74 to 3 s.f.
rmse = \sqrt{(\frac{1}{n})\sum_{i=1}^{n}(y_{i} - x_{i})^{2}}
import sklearn.metrics import math S1 = [2, 5, 9, 2] S2 = [6, 3, 6, 1] mse = sklearn.metrics.mean_squared_error(S1, S2) rmse = math.sqrt(mse) print(rmse)