@Override public Object doWork(Object... values) throws IOException { // at this point we know every incoming value is an array of BigDecimals List<double[]> anovaInput = Arrays.stream(values) // for each List, convert to double[] .map(value -> ((List<Number>)value).stream().mapToDouble(Number::doubleValue).toArray()) // turn into List<double[]> .collect(Collectors.toList()); OneWayAnova anova = new OneWayAnova(); double p = anova.anovaPValue(anovaInput); double f = anova.anovaFValue(anovaInput); Map<String,Number> m = new HashMap<>(); m.put("p-value", p); m.put("f-ratio", f); return new Tuple(m); }
anovaImpl = new OneWayAnova();