@Test(expected = CardinalityException.class)
public void testPredictOnAnObservationWithWrongCardinality() {

    Vector weights = new DenseVector(new double[] {2.0, 3.0});
    LogisticRegressionModel mdl = new LogisticRegressionModel(weights, 1.0);
    Vector observation = new DenseVector(new double[] {1.0});
    mdl.predict(observation);
}