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

Method fit

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

Source from the content-addressed store, hash-verified

38 self.loss_grad = None
39
40 def fit(self, X, y=None):
41 self._setup_input(X, y)
42 # bias
43 self.wo = 0.0
44 # Feature weights
45 self.w = np.zeros(self.n_features)
46 # Factor weights
47 self.v = np.random.normal(
48 scale=self.init_stdev, size=(self.n_features, self.n_components)
49 )
50 self._train()
51
52 def _train(self):
53 for epoch in range(self.max_iter):

Callers 2

fitMethod · 0.45
fitMethod · 0.45

Calls 2

_trainMethod · 0.95
_setup_inputMethod · 0.80

Tested by

no test coverage detected