@Test(expected = CardinalityException.class) public void testPredictOnAnObservationWithWrongCardinality() { Vector weights = new DenseVector(new double[]{2.0, 3.0}); LinearRegressionModel mdl = new LinearRegressionModel(weights, 1.0); Vector observation = new DenseVector(new double[]{1.0}); mdl.predict(observation); }
@Override public Double predict(Vector input) { return input.dot(weights) + intercept; }
LinearRegressionModel implements IgniteModel<Vector, Double>, Exportable<LinearRegressionModel>, Serializable { @Override public Double predict(Vector input) { return input.dot(weights) + intercept; } }
LinearRegressionModel implements IgniteModel<Vector, Double>, Exportable<LinearRegressionModel>, Serializable { @Override public Double predict(Vector input) { return input.dot(weights) + intercept; } LinearRegressionModel(Vector weights, double intercept); }
LinearRegressionModel implements IgniteModel<Vector, Double>, Exportable<LinearRegressionModel>, Serializable { @Override public Double predict(Vector input) { return input.dot(weights) + intercept; } LinearRegressionModel(Vector weights, double intercept); Vector getWeights(); double getIntercept(); @Override Double predict(Vector input); @Override void saveModel(Exporter<LinearRegressionModel, P> exporter, P path); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override String toString(boolean pretty); }
LinearRegressionModel implements IgniteModel<Vector, Double>, Exportable<LinearRegressionModel>, Serializable { @Override public Double predict(Vector input) { return input.dot(weights) + intercept; } LinearRegressionModel(Vector weights, double intercept); Vector getWeights(); double getIntercept(); @Override Double predict(Vector input); @Override void saveModel(Exporter<LinearRegressionModel, P> exporter, P path); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override String toString(boolean pretty);  }