LinearModel { public void addDelta(Vector delta) { this.hyperplane = this.hyperplane.plus(delta); } LinearModel(Vector hyperplane, double displacement, double threshold);  LinearModel(Vector hyperplane); boolean classify(Vector dataPoint); void addDelta(Vector delta); @Override String toString(); void shiftBias(double factor); void timesDelta(int index, double delta);  }
@Test public void testAddDelta() { double[] values = {1.0, -1.0, 1.0, -1.0, 1.0}; this.model.addDelta(new DenseVector(values)); double[] valuesFalse = {1.0, 0.0, 1.0, 0.0, 1.0}; Vector dataPointFalse = new DenseVector(valuesFalse); assertTrue(this.model.classify(dataPointFalse)); double[] valuesTrue = {0.0, 1.0, 0.0, 1.0, 0.0}; Vector dataPointTrue = new DenseVector(valuesTrue); assertFalse(this.model.classify(dataPointTrue)); }