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

Method fit

modAL/models/learners.py:513–525  ·  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

511 super()._add_training_data(X, y)
512
513 def fit(self, X: modALinput, y: modALinput, **fit_kwargs) -> 'BaseCommittee':
514 """
515 Fits every learner to a subset sampled with replacement from X. Calling this method makes the learner forget the
516 data it has seen up until this point and replaces it with X! If you would like to perform bootstrapping on each
517 learner using the data it has seen, use the method .rebag()!
518 Calling this method makes the learner forget the data it has seen up until this point and replaces it with X!
519 Args:
520 X: The samples to be fitted on.
521 y: The corresponding labels.
522 **fit_kwargs: Keyword arguments to be passed to the fit method of the predictor.
523 """
524 super().fit(X, y, **fit_kwargs)
525 self._set_classes()
526
527 def teach(self, X: modALinput, y: modALinput, bootstrap: bool = False, only_new: bool = False, **fit_kwargs) -> None:
528 """

Callers 1

_fit_to_knownMethod · 0.45

Calls 1

_set_classesMethod · 0.95

Tested by

no test coverage detected