calculates the `` cost '' of a model . e.g. when run on the training data , how closely do the predictions match the test data uses least absolute differences to calculate error . note that this is not scale free , but seems to work fairly well in practice concode_field_sep PlaceHolder placeHolder concode_field_sep MovAvgModel minimize concode_elem_sep double acceptanceProbability
double function ( MovAvgModel arg0 , EvictingQueue < Double > arg1 , double [ ] arg2 ) { double loc0 = 0 ; double [ ] loc1 = arg0 . predict ( arg1 , arg2 . length ) ; assert ( loc1 . length == arg2 . length ) ; for ( int loc2 = 0 ; loc2 < loc1 . length ; loc2 ++ ) { loc0 += Math . abs ( arg2 [ loc2 ] - loc1 [ loc2 ] ) ; } return loc0 ; }