get org.apache.commons.math3.exception.dimensionmissmatchexception:0!=2

3vpjnl9f  于 2021-07-09  发布在  Java
关注(0)|答案(0)|浏览(254)

我正在尝试生成一个卡方独立性测试我有两个数组列表首先我将它们转换成长数组,然后我缩放这两个数组并生成一个矩形的2*2数组,然后使用它进行卡方测试,在这里我得到org.apache.commons.math3.exception.dimensionmissmatchexception:0!=2

List<Long> functionCount = new ArrayList<>();
List<Long> funErrorsCount = new ArrayList<>();
map1.forEach((String, Long)-> functionCount.add(totalFunctionCounts)); // iteratively adding value in the list
map1.forEach((String, Long)-> funErrorsCount.add(funErrorCount)); // iteratively adding value in the list
final long[] totalFunctionCount = functionCount.stream().mapToLong(l->l).toArray();
final long[] totalFunctionErrorCount = funErrorsCount.stream().mapToLong(l->l).toArray();
final long[][] subtractedInputValues = subtractErrorFromCountAndScaleInput(totalFunctionCount, totalFunctionErrorCount); // scaling the input value
double Metric = generateMetric(subtractedInputValues); // Chi-Square test

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题