(self, X=None)
| 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 | |
| 75 | class FMRegressor(BaseFM): |