Adds X and y to the known training data and retrains the predictor with the augmented dataset. This method also keeps track of the maximum value encountered in the training data. Args: X: The new samples for which the values are supplied. y: Values c
(self, X: modALinput, y: modALinput, bootstrap: bool = False, only_new: bool = False, **fit_kwargs)
| 405 | return self.X_max, self.y_max |
| 406 | |
| 407 | def teach(self, X: modALinput, y: modALinput, bootstrap: bool = False, only_new: bool = False, **fit_kwargs) -> None: |
| 408 | """ |
| 409 | Adds X and y to the known training data and retrains the predictor with the augmented dataset. This method also |
| 410 | keeps track of the maximum value encountered in the training data. |
| 411 | |
| 412 | Args: |
| 413 | X: The new samples for which the values are supplied. |
| 414 | y: Values corresponding to the new instances in X. |
| 415 | bootstrap: If True, training is done on a bootstrapped dataset. Useful for building Committee models with |
| 416 | bagging. (Default value = False) |
| 417 | only_new: If True, the model is retrained using only X and y, ignoring the previously provided examples. |
| 418 | Useful when working with models where the .fit() method doesn't retrain the model from scratch (for |
| 419 | example, in tensorflow or keras). |
| 420 | **fit_kwargs: Keyword arguments to be passed to the fit method of the predictor. |
| 421 | """ |
| 422 | self._add_training_data(X, y) |
| 423 | |
| 424 | if not only_new: |
| 425 | self._fit_to_known(bootstrap=bootstrap, **fit_kwargs) |
| 426 | else: |
| 427 | self._fit_on_new(X, y, bootstrap=bootstrap, **fit_kwargs) |
| 428 | |
| 429 | self._set_max(X, y) |
| 430 | |
| 431 | |
| 432 | """ |