Add SHAP interaction effects, fix minor bug, and add cox loss (#3043)

* Add interaction effects and cox loss

* Minimize whitespace changes

* Cox loss now no longer needs a pre-sorted dataset.

* Address code review comments

* Remove mem check, rename to pred_interactions, include bias

* Make lint happy

* More lint fixes

* Fix cox loss indexing

* Fix main effects and tests

* Fix lint

* Use half interaction values on the off-diagonals

* Fix lint again
This commit is contained in:
Scott Lundberg
2018-02-07 18:38:01 -08:00
committed by Vadim Khotilovich
parent 077abb35cd
commit d878c36c84
19 changed files with 638 additions and 125 deletions

View File

@@ -172,3 +172,15 @@ TEST(Objective, TweedieRegressionBasic) {
EXPECT_NEAR(preds[i], out_preds[i], 0.01f);
}
}
TEST(Objective, CoxRegressionGPair) {
xgboost::ObjFunction * obj = xgboost::ObjFunction::Create("survival:cox");
std::vector<std::pair<std::string, std::string> > args;
obj->Configure(args);
CheckObjFunction(obj,
{ 0, 0.1f, 0.9f, 1, 0, 0.1f, 0.9f, 1},
{ 0, -2, -2, 2, 3, 5, -10, 100},
{ 1, 1, 1, 1, 1, 1, 1, 1},
{ 0, 0, 0, -0.799f, -0.788f, -0.590f, 0.910f, 1.006f},
{ 0, 0, 0, 0.160f, 0.186f, 0.348f, 0.610f, 0.639f});
}