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

Method vote

modAL/models/learners.py:582–596  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 2

test_predictMethod · 0.95
test_voteMethod · 0.95

Calls 1

predictMethod · 0.45

Tested by 2

test_predictMethod · 0.76
test_voteMethod · 0.76