Adds X and y to the known training data and retrains the predictor 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 True, traini
(self, X: modALinput, y: modALinput, bootstrap: bool = False, only_new: bool = False, **fit_kwargs)
| 158 | return self._fit_to_known(bootstrap=bootstrap, **fit_kwargs) |
| 159 | |
| 160 | def teach(self, X: modALinput, y: modALinput, bootstrap: bool = False, only_new: bool = False, **fit_kwargs) -> None: |
| 161 | """ |
| 162 | Adds X and y to the known training data and retrains the predictor with the augmented dataset. |
| 163 | |
| 164 | Args: |
| 165 | X: The new samples for which the labels are supplied by the expert. |
| 166 | y: Labels corresponding to the new instances in X. |
| 167 | bootstrap: If True, training is done on a bootstrapped dataset. Useful for building Committee models |
| 168 | with bagging. |
| 169 | only_new: If True, the model is retrained using only X and y, ignoring the previously provided examples. |
| 170 | Useful when working with models where the .fit() method doesn't retrain the model from scratch (e. g. in |
| 171 | tensorflow or keras). |
| 172 | **fit_kwargs: Keyword arguments to be passed to the fit method of the predictor. |
| 173 | """ |
| 174 | if not only_new: |
| 175 | self._add_training_data(X, y) |
| 176 | self._fit_to_known(bootstrap=bootstrap, **fit_kwargs) |
| 177 | else: |
| 178 | check_X_y(X, y, accept_sparse=True, ensure_2d=False, allow_nd=True, multi_output=True, dtype=None, |
| 179 | force_all_finite=self.force_all_finite) |
| 180 | self._fit_on_new(X, y, bootstrap=bootstrap, **fit_kwargs) |
| 181 | |
| 182 | |
| 183 | class DeepActiveLearner(BaseLearner): |