MCPcopy Index your code
hub / github.com/rushter/MLAlgorithms / _predict

Method _predict

mla/fm.py:67–72  ·  view source on GitHub ↗
(self, X=None)

Source from the content-addressed store, hash-verified

65 self.v[i] -= self.lr * v_grad + (2 * self.reg_v * self.v[i])
66
67 def _predict(self, X=None):
68 linear_output = np.dot(X, self.w)
69 factors_output = (
70 np.sum(np.dot(X, self.v) ** 2 - np.dot(X**2, self.v**2), axis=1) / 2.0
71 )
72 return self.wo + linear_output + factors_output
73
74
75class FMRegressor(BaseFM):

Callers 2

_trainMethod · 0.95
predictMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected