Predicts the labels for the supplied data for each learner in the Committee. Args: X: The samples to cast votes. **predict_kwargs: Keyword arguments to be passed to the :meth:`predict` of the learners. Returns: The predicted class for each
(self, X: modALinput, **predict_kwargs)
| 580 | return accuracy_score(y, y_pred, sample_weight=sample_weight) |
| 581 | |
| 582 | def vote(self, X: modALinput, **predict_kwargs) -> Any: |
| 583 | """ |
| 584 | Predicts the labels for the supplied data for each learner in the Committee. |
| 585 | Args: |
| 586 | X: The samples to cast votes. |
| 587 | **predict_kwargs: Keyword arguments to be passed to the :meth:`predict` of the learners. |
| 588 | Returns: |
| 589 | The predicted class for each learner in the Committee and each sample in X. |
| 590 | """ |
| 591 | prediction = np.zeros(shape=(X.shape[0], len(self.learner_list))) |
| 592 | |
| 593 | for learner_idx, learner in enumerate(self.learner_list): |
| 594 | prediction[:, learner_idx] = learner.predict(X, **predict_kwargs) |
| 595 | |
| 596 | return prediction |
| 597 | |
| 598 | def vote_proba(self, X: modALinput, **predict_proba_kwargs) -> Any: |
| 599 | """ |