add proptype of predleaf in R, fix bug in lambda rank

This commit is contained in:
tqchen
2015-01-19 09:07:37 -08:00
parent b9650f19c1
commit 632fdbbf5c
4 changed files with 16 additions and 8 deletions

View File

@@ -348,9 +348,9 @@ class LambdaRankObj : public IObjFunction {
float h = loss.SecondOrderGradient(p, 1.0f);
// accumulate gradient and hessian in both pid, and nid
gpair[pos.rindex].grad += g * w;
gpair[pos.rindex].hess += 2.0f * h;
gpair[pos.rindex].hess += 2.0f * w * h;
gpair[neg.rindex].grad -= g * w;
gpair[neg.rindex].hess += 2.0f * h;
gpair[neg.rindex].hess += 2.0f * w * h;
}
}
}