@@ -210,12 +210,14 @@ def make_eval_results(results: List[view_types.EvalResult],
210
210
211
211
def load_eval_results (
212
212
output_paths : Union [Text , List [Text ]],
213
+ output_file_format : Optional [Text ] = '' ,
213
214
mode : Text = constants .MODEL_CENTRIC_MODE ,
214
215
model_name : Optional [Text ] = None ) -> view_types .EvalResults :
215
216
"""Loads results for multiple models or multiple data sets.
216
217
217
218
Args:
218
219
output_paths: A single path or list of output paths of completed tfma runs.
220
+ output_file_format: Optional file extension to filter files by.
219
221
mode: The mode of the evaluation. Currently, tfma.DATA_CENTRIC_MODE and
220
222
tfma.MODEL_CENTRIC_MODE are supported.
221
223
model_name: Filters to only return results for given model. If unset all
@@ -235,17 +237,21 @@ def load_eval_results(
235
237
else :
236
238
model_names = [model_name ]
237
239
for model_name in model_names :
238
- results .append (load_eval_result (output_path , model_name = model_name ))
240
+ results .append (
241
+ load_eval_result (
242
+ output_path , output_file_format , model_name = model_name ))
239
243
return make_eval_results (results , mode )
240
244
241
245
242
246
def load_eval_result (
243
247
output_path : Text ,
248
+ output_file_format : Optional [Text ] = '' ,
244
249
model_name : Optional [Text ] = None ) -> view_types .EvalResult :
245
250
"""Loads EvalResult object for use with the visualization functions.
246
251
247
252
Args:
248
253
output_path: Output directory containing config, metrics, plots, etc.
254
+ output_file_format: Optional file extension to filter files by.
249
255
model_name: Optional model name. Required if multi-model evaluation was run.
250
256
251
257
Returns:
@@ -259,12 +265,12 @@ def load_eval_result(
259
265
eval_config_writer .load_eval_run (output_path ))
260
266
metrics_list = []
261
267
for p in metrics_plots_and_validations_writer .load_and_deserialize_metrics (
262
- output_path ):
268
+ output_path , output_file_format ):
263
269
metrics_list .append (
264
270
util .convert_metrics_proto_to_dict (p , model_name = model_name ))
265
271
plots_list = []
266
272
for p in metrics_plots_and_validations_writer .load_and_deserialize_plots (
267
- output_path ):
273
+ output_path , output_file_format ):
268
274
plots_list .append (
269
275
util .convert_plots_proto_to_dict (p , model_name = model_name ))
270
276
if not model_locations :
0 commit comments