@Test
public void testPredict() {

    Vector weights = new DenseVector(new double[] {2.0, 3.0});
    assertFalse(new LogisticRegressionModel(weights, 1.0).isKeepingRawLabels());
    assertEquals(0.1, new LogisticRegressionModel(weights, 1.0).withThreshold(0.1).threshold(), 0);
    assertTrue(!new LogisticRegressionModel(weights, 1.0).toString().isEmpty());
    assertTrue(!new LogisticRegressionModel(weights, 1.0).toString(true).isEmpty());
    assertTrue(!new LogisticRegressionModel(weights, 1.0).toString(false).isEmpty());
    verifyPredict(new LogisticRegressionModel(weights, 1.0).withRawLabels(true));
    verifyPredict(new LogisticRegressionModel(null, 1.0).withRawLabels(true).withWeights(weights));
    verifyPredict(new LogisticRegressionModel(weights, 1.0).withRawLabels(true).withThreshold(0.5));
    verifyPredict(new LogisticRegressionModel(weights, 0.0).withRawLabels(true).withIntercept(1.0));
}