Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the deprecated log_xxx_metadata calls #28

Merged
merged 7 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ jobs:
with:
stack-name: ${{ matrix.stack-name }}
python-version: ${{ matrix.python-version }}
ref-zenml: ${{ inputs.ref-zenml || 'develop' }}
ref-zenml: ${{ inputs.ref-zenml || 'feature/followup-run-metadata' }}
bcdurak marked this conversation as resolved.
Show resolved Hide resolved
ref-template: ${{ inputs.ref-template || github.ref }}
7 changes: 4 additions & 3 deletions template/steps/data_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from sklearn.preprocessing import MinMaxScaler
from typing_extensions import Annotated
from utils.preprocess import ColumnsDropper, DataFrameCaster, NADropper
from zenml import log_artifact_metadata, step
from zenml import log_metadata, step


@step
Expand Down Expand Up @@ -67,8 +67,9 @@ def data_preprocessor(
dataset_tst = preprocess_pipeline.transform(dataset_tst)

# Log metadata so we can load it in the inference pipeline
log_artifact_metadata(
artifact_name="preprocess_pipeline",
log_metadata(
metadata={"random_state": random_state, "target": target},
artifact_name="preprocess_pipeline",
infer_artifact=True,
)
return dataset_trn, dataset_tst, preprocess_pipeline
5 changes: 3 additions & 2 deletions template/steps/model_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pandas as pd
from sklearn.base import ClassifierMixin
from zenml import log_artifact_metadata, step
from zenml import log_metadata, step
from zenml.logger import get_logger

logger = get_logger(__name__)
Expand Down Expand Up @@ -79,8 +79,9 @@ def model_evaluator(
for message in messages:
logger.warning(message)

log_artifact_metadata(
log_metadata(
metadata={"train_accuracy": float(trn_acc), "test_accuracy": float(tst_acc)},
artifact_name="sklearn_classifier",
infer_artifact=True,
)
return float(tst_acc)
Loading