@Test(expected = IllegalArgumentException.class) public void testIllegalArguments() { WeightedPredictionsAggregator aggregator = new WeightedPredictionsAggregator(new double[] {1.0, 0.5, 0.25}); aggregator.apply(new double[] { }); }
@Override public Double apply(double[] answers) { A.ensure(answers.length == weights.length, "Composition vector must have same size as weights vector"); double res = bias; for (int i = 0; i < answers.length; i++) res += weights[i] * answers[i]; return res; }
WeightedPredictionsAggregator implements PredictionsAggregator { @Override public Double apply(double[] answers) { A.ensure(answers.length == weights.length, "Composition vector must have same size as weights vector"); double res = bias; for (int i = 0; i < answers.length; i++) res += weights[i] * answers[i]; return res; } }
WeightedPredictionsAggregator implements PredictionsAggregator { @Override public Double apply(double[] answers) { A.ensure(answers.length == weights.length, "Composition vector must have same size as weights vector"); double res = bias; for (int i = 0; i < answers.length; i++) res += weights[i] * answers[i]; return res; } WeightedPredictionsAggregator(double[] weights);  WeightedPredictionsAggregator(double[] weights, double bias); }
WeightedPredictionsAggregator implements PredictionsAggregator { @Override public Double apply(double[] answers) { A.ensure(answers.length == weights.length, "Composition vector must have same size as weights vector"); double res = bias; for (int i = 0; i < answers.length; i++) res += weights[i] * answers[i]; return res; } WeightedPredictionsAggregator(double[] weights);  WeightedPredictionsAggregator(double[] weights, double bias); @Override Double apply(double[] answers); @Override String toString(); @Override String toString(boolean pretty); double[] getWeights(); double getBias(); }
WeightedPredictionsAggregator implements PredictionsAggregator { @Override public Double apply(double[] answers) { A.ensure(answers.length == weights.length, "Composition vector must have same size as weights vector"); double res = bias; for (int i = 0; i < answers.length; i++) res += weights[i] * answers[i]; return res; } WeightedPredictionsAggregator(double[] weights);  WeightedPredictionsAggregator(double[] weights, double bias); @Override Double apply(double[] answers); @Override String toString(); @Override String toString(boolean pretty); double[] getWeights(); double getBias();  }