/** * Creates a constant evaluator for the weighted mean output value of the * given dataset. * * @param data The dataset of input-output pairs to use. * @return A constant evaluator for the weighted mean output value. */ @Override public ConstantEvaluator<Double> learn( final Collection<? extends InputOutputPair<?, Double>> data) { // Compute the weighted mean. final double mean = DatasetUtil.computeWeightedOutputMean(data); return new ConstantEvaluator<Double>(mean); } }
/** * Creates a constant evaluator for the weighted mean output value of the * given dataset. * * @param data The dataset of input-output pairs to use. * @return A constant evaluator for the weighted mean output value. */ @Override public ConstantEvaluator<Double> learn( final Collection<? extends InputOutputPair<?, Double>> data) { // Compute the weighted mean. final double mean = DatasetUtil.computeWeightedOutputMean(data); return new ConstantEvaluator<Double>(mean); } }
/** * Creates a constant evaluator for the weighted mean output value of the * given dataset. * * @param data The dataset of input-output pairs to use. * @return A constant evaluator for the weighted mean output value. */ @Override public ConstantEvaluator<Double> learn( final Collection<? extends InputOutputPair<?, Double>> data) { // Compute the weighted mean. final double mean = DatasetUtil.computeWeightedOutputMean(data); return new ConstantEvaluator<Double>(mean); } }