MCPcopy Create free account
hub / github.com/modAL-python/modAL / fit

Method fit

modAL/models/base.py:271–285  ·  view source on GitHub ↗

Fits every learner to a subset sampled with replacement from X. Calling this method makes the learner forget the data it has seen up until this point and replaces it with X! If you would like to perform bootstrapping on each learner using the data it has seen, use the method

(self, X: modALinput, y: modALinput, **fit_kwargs)

Source from the content-addressed store, hash-verified

269 learner._fit_on_new(X, y, bootstrap=bootstrap, **fit_kwargs)
270
271 def fit(self, X: modALinput, y: modALinput, **fit_kwargs) -> 'BaseCommittee':
272 """
273 Fits every learner to a subset sampled with replacement from X. Calling this method makes the learner forget the
274 data it has seen up until this point and replaces it with X! If you would like to perform bootstrapping on each
275 learner using the data it has seen, use the method .rebag()!
276 Calling this method makes the learner forget the data it has seen up until this point and replaces it with X!
277 Args:
278 X: The samples to be fitted on.
279 y: The corresponding labels.
280 **fit_kwargs: Keyword arguments to be passed to the fit method of the predictor.
281 """
282 for learner in self.learner_list:
283 learner.fit(X, y, **fit_kwargs)
284
285 return self
286
287 def transform_without_estimating(self, X: modALinput) -> Union[np.ndarray, sp.csr_matrix]:
288 """

Callers

nothing calls this directly

Calls 1

fitMethod · 0.45

Tested by

no test coverage detected