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

Method teach

modAL/models/learners.py:527–538  ·  view source on GitHub ↗

Adds X and y to the known training data for each learner and retrains learners with the augmented dataset. Args: X: The new samples for which the labels are supplied by the expert. y: Labels corresponding to the new instances in X. bootstrap: If T

(self, X: modALinput, y: modALinput, bootstrap: bool = False, only_new: bool = False, **fit_kwargs)

Source from the content-addressed store, hash-verified

525 self._set_classes()
526
527 def teach(self, X: modALinput, y: modALinput, bootstrap: bool = False, only_new: bool = False, **fit_kwargs) -> None:
528 """
529 Adds X and y to the known training data for each learner and retrains learners with the augmented dataset.
530 Args:
531 X: The new samples for which the labels are supplied by the expert.
532 y: Labels corresponding to the new instances in X.
533 bootstrap: If True, trains each learner on a bootstrapped set. Useful when building the ensemble by bagging.
534 only_new: If True, the model is retrained using only X and y, ignoring the previously provided examples.
535 **fit_kwargs: Keyword arguments to be passed to the fit method of the predictor.
536 """
537 super().teach(X, y, bootstrap=bootstrap, only_new=only_new, **fit_kwargs)
538 self._set_classes()
539
540 def predict(self, X: modALinput, **predict_proba_kwargs) -> Any:
541 """

Callers 3

test_teachMethod · 0.95
test_on_transformedMethod · 0.95
modAL_QBCFunction · 0.95

Calls 1

_set_classesMethod · 0.95

Tested by 2

test_teachMethod · 0.76
test_on_transformedMethod · 0.76