MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / mse

Function mse

recommenders/userbased.py:159–162  ·  view source on GitHub ↗
(p, t)

Source from the content-addressed store, hash-verified

157
158# calculate accuracy
159def mse(p, t):
160 p = np.array(p)
161 t = np.array(t)
162 return np.mean((p - t)**2)
163
164print('train mse:', mse(train_predictions, train_targets))
165print('test mse:', mse(test_predictions, test_targets))

Callers 2

userbased.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected