From e16f893ab6b9113c6c20ac2aed31d154a7107ded Mon Sep 17 00:00:00 2001 From: panstav1 Date: Tue, 21 Nov 2023 10:53:06 +0200 Subject: [PATCH] test the random forest model in the main pipeline --- components/test_regression_model/conda.yml | 6 ++++-- components/test_regression_model/run.py | 2 +- main.py | 13 ++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/components/test_regression_model/conda.yml b/components/test_regression_model/conda.yml index 00093af38..618901ac4 100644 --- a/components/test_regression_model/conda.yml +++ b/components/test_regression_model/conda.yml @@ -4,9 +4,11 @@ channels: - defaults dependencies: - pandas=1.1.4 + - numpy==1.24.4 - pip=20.3.3 - - mlflow=1.14.1 - scikit-learn=0.24.1 - pip: - - wandb==0.10.31 + - protobuf==3.20.* + - mlflow==2.2.2 + - wandb==0.12.17 - git+https://github.com/udacity/nd0821-c2-build-model-workflow-starter.git#egg=wandb-utils&subdirectory=components diff --git a/components/test_regression_model/run.py b/components/test_regression_model/run.py index f08b598e0..64e4d2aaf 100644 --- a/components/test_regression_model/run.py +++ b/components/test_regression_model/run.py @@ -30,7 +30,7 @@ def go(args): test_dataset_path = run.use_artifact(args.test_dataset).file() # Read test dataset - X_test = pd.read_csv(test_dataset_path) + X_test = pd.read_parquet(test_dataset_path) y_test = X_test.pop("price") logger.info("Loading model and performing inference on test set") diff --git a/main.py b/main.py index b45a44189..ca85383f9 100644 --- a/main.py +++ b/main.py @@ -113,13 +113,12 @@ def go(config: DictConfig): if "test_regression_model" in active_steps: - - ################## - # Implement here # - ################## - - pass - + _ = mlflow.run (os.path.join(root_path, f"{config['main']['components_repository']}/test_regression_model"), + 'main', + parameters={ + "mlflow_model": config['modeling']['output_artifact'] +':prod', + "test_dataset": 'test_data.parquet:latest' + }) if __name__ == "__main__": go()