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

Function mse

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

Source from the content-addressed store, hash-verified

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

Callers 1

itembased.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected