Predicts the class of the samples by picking the consensus prediction. Args: X: The samples to be predicted. **predict_proba_kwargs: Keyword arguments to be passed to the :meth:`predict_proba` of the Committee. Returns: The predicted class
(self, X: modALinput, **predict_proba_kwargs)
| 538 | self._set_classes() |
| 539 | |
| 540 | def predict(self, X: modALinput, **predict_proba_kwargs) -> Any: |
| 541 | """ |
| 542 | Predicts the class of the samples by picking the consensus prediction. |
| 543 | Args: |
| 544 | X: The samples to be predicted. |
| 545 | **predict_proba_kwargs: Keyword arguments to be passed to the :meth:`predict_proba` of the Committee. |
| 546 | Returns: |
| 547 | The predicted class labels for X. |
| 548 | """ |
| 549 | # getting average certainties |
| 550 | proba = self.predict_proba(X, **predict_proba_kwargs) |
| 551 | # finding the sample-wise max probability |
| 552 | max_proba_idx = np.argmax(proba, axis=1) |
| 553 | # translating label indices to labels |
| 554 | return self.classes_[max_proba_idx] |
| 555 | |
| 556 | def predict_proba(self, X: modALinput, **predict_proba_kwargs) -> Any: |
| 557 | """ |
no test coverage detected