for (TargetEstimatePair<? extends Double, ? extends Double> pair : data) final double target = pair.getTarget(); final double estimate = pair.getEstimate(); final double difference = target - estimate;
for (TargetEstimatePair<? extends Double, ? extends Double> pair : data) final double target = pair.getTarget(); final double estimate = pair.getEstimate(); final double difference = target - estimate;
for (TargetEstimatePair<? extends Double, ? extends Double> pair : data) final double target = pair.getTarget(); final double estimate = pair.getEstimate(); final double difference = target - estimate;
for (TargetEstimatePair<? extends Double, ? extends Double> pair : data) final double target = pair.getTarget(); final double estimate = pair.getEstimate(); final double difference = target - estimate;
for (TargetEstimatePair<? extends Double, ? extends Double> pair : data) final double target = pair.getTarget(); final double estimate = pair.getEstimate(); final double difference = target - estimate;
for (TargetEstimatePair<? extends Double, ? extends Double> pair : data) final double target = pair.getTarget(); final double estimate = pair.getEstimate(); final double difference = target - estimate;
for (TargetEstimatePair<? extends Double, ? extends Double> pair : data) final double target = pair.getTarget(); final double estimate = pair.getEstimate(); final double difference = target - estimate;
for (TargetEstimatePair<? extends Double, ? extends Double> pair : data) final double target = pair.getTarget(); final double estimate = pair.getEstimate(); final double difference = target - estimate;
for (TargetEstimatePair<? extends Double, ? extends Double> pair : data) final double target = pair.getTarget(); final double estimate = pair.getEstimate(); final double difference = target - estimate;
: data) final DataType target = pair.getTarget(); final DataType estimate = pair.getEstimate();
: data) final DataType target = pair.getTarget(); final DataType estimate = pair.getEstimate();
: data) final DataType target = pair.getTarget(); final DataType estimate = pair.getEstimate();
@Override public ConfusionMatrix<CategoryType> evaluatePerformance( final Collection<? extends TargetEstimatePair<? extends CategoryType, ? extends CategoryType>> data) { // Create the confusion matrix and add each target-estimate pair to it. final ConfusionMatrix<CategoryType> result = this.getFactory().create(); for (TargetEstimatePair<? extends CategoryType, ? extends CategoryType> pair : data) { result.add(pair.getTarget(), pair.getEstimate()); } return result; }
@Override public ConfusionMatrix<CategoryType> evaluatePerformance( final Collection<? extends TargetEstimatePair<? extends CategoryType, ? extends CategoryType>> data) { // Create the confusion matrix and add each target-estimate pair to it. final ConfusionMatrix<CategoryType> result = this.getFactory().create(); for (TargetEstimatePair<? extends CategoryType, ? extends CategoryType> pair : data) { result.add(pair.getTarget(), pair.getEstimate()); } return result; }
@Override public ConfusionMatrix<CategoryType> evaluatePerformance( final Collection<? extends TargetEstimatePair<? extends CategoryType, ? extends CategoryType>> data) { // Create the confusion matrix and add each target-estimate pair to it. final ConfusionMatrix<CategoryType> result = this.getFactory().create(); for (TargetEstimatePair<? extends CategoryType, ? extends CategoryType> pair : data) { result.add(pair.getTarget(), pair.getEstimate()); } return result; }
/** * Creates a new {@code DefaultConfusionMatrix} from the given * actual-predicted pairs. * * @param <CategoryType> * The category type. * @param pairs * The actual-category pairs. * @return * A new confusion matrix populated from the given actual-category * pairs. */ public static <CategoryType> DefaultConfusionMatrix<CategoryType> createUnweighted( final Collection<? extends TargetEstimatePair<? extends CategoryType, ? extends CategoryType>> pairs) { final DefaultConfusionMatrix<CategoryType> result = new DefaultConfusionMatrix<CategoryType>(); for (TargetEstimatePair<? extends CategoryType, ? extends CategoryType> item : pairs) { result.add(item.getTarget(), item.getEstimate()); } return result; }
@Override public Double evaluatePerformance( Collection<? extends TargetEstimatePair<? extends Vector, ? extends Vector>> data ) { double sumSquaredError = 0.0; double denominator = 0.0; for (TargetEstimatePair<? extends Vector, ? extends Vector> pair : data) { // Compute the error vector. Vector target = pair.getTarget(); Vector estimate = pair.getEstimate(); double errorSquared = target.euclideanDistanceSquared( estimate ); double weight = DatasetUtil.getWeight(pair); sumSquaredError += weight * errorSquared; denominator += weight; } double meanSquaredError = 0.0; if (denominator != 0.0) { meanSquaredError = sumSquaredError / denominator; } return meanSquaredError; }
@Override public Double evaluatePerformance( Collection<? extends TargetEstimatePair<? extends Vector, ? extends Vector>> data ) { double sumSquaredError = 0.0; double denominator = 0.0; for (TargetEstimatePair<? extends Vector, ? extends Vector> pair : data) { // Compute the error vector. Vector target = pair.getTarget(); Vector estimate = pair.getEstimate(); double errorSquared = target.euclideanDistanceSquared( estimate ); double weight = DatasetUtil.getWeight(pair); sumSquaredError += weight * errorSquared; denominator += weight; } double meanSquaredError = 0.0; if (denominator != 0.0) { meanSquaredError = sumSquaredError / denominator; } return meanSquaredError; }
/** * Creates a new {@code DefaultConfusionMatrix} from the given * actual-predicted pairs. * * @param <CategoryType> * The category type. * @param pairs * The actual-category pairs. * @return * A new confusion matrix populated from the given actual-category * pairs. */ public static <CategoryType> DefaultConfusionMatrix<CategoryType> createUnweighted( final Collection<? extends TargetEstimatePair<? extends CategoryType, ? extends CategoryType>> pairs) { final DefaultConfusionMatrix<CategoryType> result = new DefaultConfusionMatrix<CategoryType>(); for (TargetEstimatePair<? extends CategoryType, ? extends CategoryType> item : pairs) { result.add(item.getTarget(), item.getEstimate()); } return result; }
@Override public Double evaluatePerformance( Collection<? extends TargetEstimatePair<? extends Vector, ? extends Vector>> data ) { double sumSquaredError = 0.0; double denominator = 0.0; for (TargetEstimatePair<? extends Vector, ? extends Vector> pair : data) { // Compute the error vector. Vector target = pair.getTarget(); Vector estimate = pair.getEstimate(); double errorSquared = target.euclideanDistanceSquared( estimate ); double weight = DatasetUtil.getWeight(pair); sumSquaredError += weight * errorSquared; denominator += weight; } double meanSquaredError = 0.0; if (denominator != 0.0) { meanSquaredError = sumSquaredError / denominator; } return meanSquaredError; }