Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct EvalPoissonNegLogLik : public EvalEWiseBase {
- const char *Name() const override {
- return "poisson-nloglik";
- }
- inline bst_float EvalRow(bst_float y, bst_float py) const {
- const bst_float eps = 1e-16f;
- if (py < eps) py = eps;
- return common::LogGamma(y + 1.0f) + py - std::log(py) * y;
- }
- }
- poisson_deviance <- function(y, py, eps) {
- mean(LogGamma(y + 1.0f) + pmax(py, eps) - log(pmax(py, eps)) * y);
- }
- setinfo(xgbMatrix, "base_margin", log(exposure))
- poisson_deviance <- function(y, py, exposure, eps) {
- mean(LogGamma(y + 1.0f) + pmax(py + log(exposure), eps) - log(pmax(py +
- log(exposure), eps)) * y);
- }
- poisson_deviance <- function(y, py) {mean(y*py - exp(py))}
- 2 * mean(y * log(y / py) - (y - py))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement