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

Method score

modAL/models/learners.py:567–580  ·  view source on GitHub ↗

Returns the mean accuracy on the given test data and labels. Todo: Why accuracy? Args: X: The samples to score. y: Ground truth labels corresponding to X. sample_weight: Sample weights. Returns: Mean accurac

(self, X: modALinput, y: modALinput, sample_weight: List[float] = None)

Source from the content-addressed store, hash-verified

565 return np.mean(self.vote_proba(X, **predict_proba_kwargs), axis=1)
566
567 def score(self, X: modALinput, y: modALinput, sample_weight: List[float] = None) -> Any:
568 """
569 Returns the mean accuracy on the given test data and labels.
570 Todo:
571 Why accuracy?
572 Args:
573 X: The samples to score.
574 y: Ground truth labels corresponding to X.
575 sample_weight: Sample weights.
576 Returns:
577 Mean accuracy of the classifiers.
578 """
579 y_pred = self.predict(X)
580 return accuracy_score(y, y_pred, sample_weight=sample_weight)
581
582 def vote(self, X: modALinput, **predict_kwargs) -> Any:
583 """

Callers

nothing calls this directly

Calls 1

predictMethod · 0.95

Tested by

no test coverage detected