MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / _loss

Method _loss

numpy_ml/factorization/factors.py:247–249  ·  view source on GitHub ↗

Return the least-squares reconstruction loss between X and Xhat

(self, X, Xhat)

Source from the content-addressed store, hash-verified

245 self.W = W
246
247 def _loss(self, X, Xhat):
248 """Return the least-squares reconstruction loss between X and Xhat"""
249 return np.sum((X - Xhat) ** 2)
250
251 def _update_H(self, X, W, H):
252 """Perform the fast HALS update for H"""

Callers 1

_fitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected