public class Predction implements Function<Double[], Double> {
private final double[] t_vector;
Predction(double[] t_vector) {
this.t_vector = Arrays.copyOf(t_vector, t_vector.length);
}
public Double apply(Double[] f_vector) {
assert f_vector[0] == 1.0;
double predc = 0;
for (int j = 0; j < t_vector.length; j++) {
predc += t_vector[j] * f_vector[j];
}
return predc;
}
Comments
Leave a comment