private List < double [ ] > calculateMeanMeasurementsForParam ( int numEntriesPerPreview , int numParamValues , int paramValue ) { List < double [ ] > paramMeasurementsSum = new ArrayList < double [ ] > ( numEntriesPerPreview ) ; List < double [ ] > meanParamMeasurements = new ArrayList < double [ ] > ( numEntriesPerPreview ) ; int numCompleteFolds = 0 ; // sum up measurement values for ( PreviewCollection < Preview > foldPreview : this . origMultiRunPreviews . subPreviews ) { // check if there is a preview for each parameter value if ( foldPreview . getPreviews ( ) . size ( ) == numParamValues ) { numCompleteFolds ++ ; Preview foldParamPreview = foldPreview . getPreviews ( ) . get ( paramValue ) ; // add this Preview's measurements to the overall sum this . addPreviewMeasurementsToSum ( paramMeasurementsSum , foldParamPreview , numEntriesPerPreview ) ; } } // divide sum by number of folds for ( int entryIdx = 0 ; entryIdx < numEntriesPerPreview ; entryIdx ++ ) { double [ ] sumEntry = paramMeasurementsSum . get ( entryIdx ) ; double [ ] meanEntry = new double [ sumEntry . length ] ; // first measurement is used for indexing -> simply copy meanEntry [ 0 ] = sumEntry [ 0 ] ; // calculate mean for remaining measurements for ( int m = 1 ; m < sumEntry . length ; m ++ ) { meanEntry [ m ] = sumEntry [ m ] / numCompleteFolds ; } meanParamMeasurements . add ( meanEntry ) ; } return meanParamMeasurements ; }
Calculate the mean measurements for the given parameter value .