protected static void lineSearch(Instances instances, int attIndex1, int attIndex2, int c1, int c21, int c22,
			double[] predictions) {
		double[] numerator = new double[4];
		double[] denominator = new double[4];
		for (Instance instance : instances) {
			int v1 = (int) instance.getValue(attIndex1);
			int v2 = (int) instance.getValue(attIndex2);
			double target = instance.getTarget();
			double t = Math.abs(target);
			if (v1 <= c1) {
				if (v2 <= c21) {
					numerator[0] += target * instance.getWeight();
					denominator[0] += t * (1 - t) * instance.getWeight();
				} else {
					numerator[1] += target * instance.getWeight();
					denominator[1] += t * (1 - t) * instance.getWeight();
				}
			} else {
				if (v2 <= c22) {
					numerator[2] += target * instance.getWeight();
					denominator[2] += t * (1 - t) * instance.getWeight();
				} else {
					numerator[3] += target * instance.getWeight();
					denominator[3] += t * (1 - t) * instance.getWeight();
				}
			}
		}
		for (int i = 0; i < numerator.length; i++) {
			predictions[i] = Math.abs(denominator[i]) < MathUtils.EPSILON ? 0.0 : numerator[i] / denominator[i];
		}
	}