From 3849b825dbc9fe3675c90183b7491caee59adbf3 Mon Sep 17 00:00:00 2001 From: Kristian Flikka Date: Thu, 18 Jun 2020 12:29:39 +0200 Subject: [PATCH] Mlflow project definition (#22) * Change location of classification_report.json * Use flass command in MLproject --- MLproject | 11 +++++++++++ flass/cli.py | 2 +- kfp/flassline.py | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 MLproject diff --git a/MLproject b/MLproject new file mode 100644 index 0000000..8bb9f2e --- /dev/null +++ b/MLproject @@ -0,0 +1,11 @@ +name: flass-mlproject + +docker_env: + image: docker.io/kminaister/flass:latest + +entry_points: + main: + parameters: + dataset: string + subset: {type: int, default: -1} + command: "flass --dataset {dataset} --subset {subset}" diff --git a/flass/cli.py b/flass/cli.py index 53453a0..d69db24 100644 --- a/flass/cli.py +++ b/flass/cli.py @@ -83,7 +83,7 @@ def flass(plot, batch_size, epochs, dataset, model_type, subset, lime): report = classification_report( y_test, y_predicted, target_names=class_names, output_dict=True ) - classification_report_file = "classification_report.json" + classification_report_file = "/tmp/classification_report.json" with open(classification_report_file, "w") as file: json.dump(report, file) logger.info( diff --git a/kfp/flassline.py b/kfp/flassline.py index c4cc3ce..6b075c1 100644 --- a/kfp/flassline.py +++ b/kfp/flassline.py @@ -28,7 +28,7 @@ def flass_onestep( batch_size, ], output_artifact_paths={ - "classification-report-json": "/home/appuser/classification_report.json" + "classification-report-json": "/tmp/classification_report.json" }, )