Here you can find the source of computeMeanSquaredError(double[] trueValues, double[] predValues)
public static double computeMeanSquaredError(double[] trueValues, double[] predValues)
//package com.java2s; //License from project: Apache License public class Main { public static double computeMeanSquaredError(double[] trueValues, double[] predValues) { double sse = 0.0; for (int i = 0; i < trueValues.length; i++) { double diff = trueValues[i] - predValues[i]; sse += diff * diff;/*from w ww . j av a 2 s . co m*/ } return sse / trueValues.length; } }