MCPcopy Create free account
hub / github.com/MingchaoZhu/DeepLearning / fit

Method fit

code/chapter7.py:198–205  ·  view source on GitHub ↗
(self, X, Y)

Source from the content-addressed store, hash-verified

196 self.n_models = n_models
197
198 def fit(self, X, Y):
199 self.models = []
200 for i in range(self.n_models):
201 print("training {} base model:".format(i))
202 X_samp, Y_samp = bootstrap_sample(X, Y)
203 model = DFN(hidden_dims_1=200, hidden_dims_2=10)
204 model.fit(X_samp, Y_samp)
205 self.models.append(model)
206
207 def predict(self, X):
208 model_preds = np.array([[np.argmax(t.forward(x)[0]) for x in X] for t in self.models])

Callers

nothing calls this directly

Calls 3

fitMethod · 0.95
bootstrap_sampleFunction · 0.85
DFNClass · 0.85

Tested by

no test coverage detected