From e2da5d2f7429877771446d871e098b4578d5233e Mon Sep 17 00:00:00 2001 From: Siddhant Sadangi Date: Wed, 27 Dec 2023 11:52:25 +0100 Subject: [PATCH] Fixed sequential pipeline example --- .../sequential-pipelines/scripts/model_validation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/how-to-guides/sequential-pipelines/scripts/model_validation.py b/how-to-guides/sequential-pipelines/scripts/model_validation.py index 3af0c4562..6c2614f5f 100644 --- a/how-to-guides/sequential-pipelines/scripts/model_validation.py +++ b/how-to-guides/sequential-pipelines/scripts/model_validation.py @@ -4,6 +4,7 @@ from neptune.exceptions import ModelNotFound, ModelVersionNotFound from neptune.types import File from sklearn.metrics import ConfusionMatrixDisplay, classification_report + from utils import * matplotlib.use("Agg") @@ -29,7 +30,10 @@ with_id=f"{project_key}-{model_key}", # Your model ID here ) model_versions_table = model.fetch_model_versions_table().to_pandas() - latest_model_version_id = model_versions_table["sys/id"].tolist()[0] + latest_model_version_id = model_versions_table.sort_values( + by="sys/creation_time", ascending=False + ).reset_index()["sys/id"][0] + except ModelNotFound: print(