1
Fungsi Kerugian Deviance Binomial Scikit
Ini adalah fungsi kerugian penyimpangan binomial scikit GradientBoosting, def __call__(self, y, pred, sample_weight=None): """Compute the deviance (= 2 * negative log-likelihood). """ # logaddexp(0, v) == log(1.0 + exp(v)) pred = pred.ravel() if sample_weight is None: return -2.0 * np.mean((y * pred) - np.logaddexp(0.0, pred)) else: return (-2.0 / sample_weight.sum() …