List of utility methods to do Mean Calculate
double | computeMean(double[] data) Compute mean value of an array of double double sum = 0; for (double aData : data) { sum += aData; return sum / data.length; |
double | computeMean(double[] results) compute Mean double mean = 0; for (double single : results) { mean += single; return mean / results.length; |
float | computeMean(float[] array) Computes the mean value of a given array float mean = 0; for (int i = 0; i < array.length; i++) { mean += array[i]; return mean / array.length; |
float | computeMean(float[] data) compute Mean float sum = 0.0f; int nPts = 0; for (int i = 0; i < data.length; i++) { if (!Float.isNaN(data[i])) { sum += data[i]; nPts++; return (nPts == 0 ? Float.NaN : sum / nPts); |
int | computeMean(int val1, int val2, float ratio) Compute the mean of row values. return (int) ((1.0f - ratio) * val2 + ratio * val1); |
double | computeMean(int[][] pixels) Calcula media de luminocidad de la matriz imagen. double means; double sum = 0; int npix = pixels.length * pixels[0].length; for (int x = 0; x < pixels.length; x++) { for (int y = 0; y < pixels[0].length; y++) { sum += pixels[x][y]; means = sum / npix; return means; |
double | computeMeanSquaredError(double[] trueValues, double[] predValues) compute Mean Squared Error double sse = 0.0; for (int i = 0; i < trueValues.length; i++) { double diff = trueValues[i] - predValues[i]; sse += diff * diff; return sse / trueValues.length; |
double | computeMeanSquareError(double[] x, double[] y) computes the mean square error of array x to array y double sum = 0; for (int i = 0; i < x.length; i++) { sum += Math.pow(x[i] - y[i], 2); return sum / x.length; |
Double | mean(ArrayList mean return sum(values) / values.size();
|
double | mean(ArrayList mean return sum(a) / a.size();
|