def objective(self, params):
        """Compute the negative penalized log-likelihood."""
        val = self._penalty * np.sum(params**2)
        for winner, losers in self._data:
            idx = np.append(winner, losers)
            val += logsumexp(params.take(idx) - params[winner])
        return val
def objective ( self , params ) : val = self . _penalty * np . sum ( params ** 2 ) for winner , losers in self . _data : idx = np . append ( winner , losers ) val += logsumexp ( params . take ( idx ) - params [ winner ] ) return val
Compute the negative penalized log-likelihood.