@Test public void testNbar() { logger.info("Nbar"); TransposeDataList clusterIdList = generateClusterIdList(); double expResult = 10.0; double result = ClusterSampling.nBar(clusterIdList); assertEquals(expResult, result, Constants.DOUBLE_ACCURACY_HIGH); }
public static double nBar(TransposeDataList clusterIdList) { int populationM = clusterIdList.size(); double nBar = 0.0; for(Map.Entry<Object, FlatDataList> entry : clusterIdList.entrySet()) { nBar += (double)entry.getValue().size()/populationM; } return nBar; }
ClusterSampling { public static double nBar(TransposeDataList clusterIdList) { int populationM = clusterIdList.size(); double nBar = 0.0; for(Map.Entry<Object, FlatDataList> entry : clusterIdList.entrySet()) { nBar += (double)entry.getValue().size()/populationM; } return nBar; } }
ClusterSampling { public static double nBar(TransposeDataList clusterIdList) { int populationM = clusterIdList.size(); double nBar = 0.0; for(Map.Entry<Object, FlatDataList> entry : clusterIdList.entrySet()) { nBar += (double)entry.getValue().size()/populationM; } return nBar; }  }
ClusterSampling { public static double nBar(TransposeDataList clusterIdList) { int populationM = clusterIdList.size(); double nBar = 0.0; for(Map.Entry<Object, FlatDataList> entry : clusterIdList.entrySet()) { nBar += (double)entry.getValue().size()/populationM; } return nBar; }  static double nBar(TransposeDataList clusterIdList); static TransposeDataCollection randomSampling(TransposeDataList clusterIdList, int sampleM); static double mean(TransposeDataCollection sampleDataCollection); static double xbarVariance(TransposeDataCollection sampleDataCollection, int populationM, double Nbar); static double xbarStd(TransposeDataCollection sampleDataCollection, int populationM, double Nbar); }
ClusterSampling { public static double nBar(TransposeDataList clusterIdList) { int populationM = clusterIdList.size(); double nBar = 0.0; for(Map.Entry<Object, FlatDataList> entry : clusterIdList.entrySet()) { nBar += (double)entry.getValue().size()/populationM; } return nBar; }  static double nBar(TransposeDataList clusterIdList); static TransposeDataCollection randomSampling(TransposeDataList clusterIdList, int sampleM); static double mean(TransposeDataCollection sampleDataCollection); static double xbarVariance(TransposeDataCollection sampleDataCollection, int populationM, double Nbar); static double xbarStd(TransposeDataCollection sampleDataCollection, int populationM, double Nbar);  }