| 50 | } |
| 51 | |
| 52 | TEST(LogisticLoss, ComputePrimalLoss) { |
| 53 | LogisticLossUpdater loss_updater; |
| 54 | EXPECT_NEAR(0.693147, |
| 55 | loss_updater.ComputePrimalLoss(0 /* wx */, 1 /* label */, |
| 56 | 1 /* example weight */), |
| 57 | 1e-3); |
| 58 | EXPECT_NEAR(0.0, |
| 59 | loss_updater.ComputePrimalLoss(70 /* wx */, 1 /* label */, |
| 60 | 1 /* example weight */), |
| 61 | 1e-3); |
| 62 | EXPECT_NEAR(0.0, |
| 63 | loss_updater.ComputePrimalLoss(-70 /* wx */, -1 /* label */, |
| 64 | 1 /* example weight */), |
| 65 | 1e-3); |
| 66 | } |
| 67 | |
| 68 | TEST(LogisticLoss, ComputeDualLoss) { |
| 69 | LogisticLossUpdater loss_updater; |
nothing calls this directly
no test coverage detected