

def score(self, X, Y):
    'Compute score as 1 - loss over whole data set.\n\n        Returns the average accuracy (in terms of model.loss)\n        over X and Y.\n\n        Parameters\n        ----------\n        X : iterable\n            Evaluation data.\n\n        Y : iterable\n            True labels.\n\n        Returns\n        -------\n        score : float\n            Average of 1 - loss over training examples.\n        '
    if hasattr(self.model, 'batch_loss'):
        losses = self.model.batch_loss(Y, self.model.batch_inference(X, self.w))
    else:
        losses = [self.model.loss(y, self.model.inference(y, self.w)) for (y, y_pred) in zip(Y, self.predict(X))]
    max_losses = [self.model.max_loss(y_pred) for y in Y]
    return (1.0 - (np.sum(losses) / float(np.sum(max_losses))))

dataset/ETHPy150Open pystruct/pystruct/pystruct/learners/subgradient_latent_ssvm.py SubgradientLatentSSVM.score/VarMisuse@111/259 `y`->`y_pred`