Skip to content

Commit 8236fec

Browse files
committed
Additional changes
1 parent 18d6fb1 commit 8236fec

File tree

4 files changed

+37
-9
lines changed

4 files changed

+37
-9
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# :: Track experiments in ZenML natively
2+
3+
Although ZenML plugs into many [experiment trackers](https://www.zenml.io/vs/zenml-vs-experiment-trackers), a lot of
4+
the functionality of experiment trackers is already covered by ZenML's native metadata and artifact tracking.
5+
This project aims to show these capabilities.
6+
7+
## :running: Run locally
8+
9+
10+
#### Option 1 - Interactively explore the quickstart using Jupyter Notebook:
11+
```bash
12+
pip install notebook
13+
jupyter notebook
14+
# open quickstart.ipynb
15+
```
16+
17+
#### Option 2 - Execute the whole ML pipeline from a Python script:
18+
```bash
19+
# Pip install all requirements
20+
pip install -r requirements.txt
21+
22+
# Install required zenml integrations
23+
zenml integration install sklearn pandas -y
24+
25+
# Initialize ZenML
26+
zenml init
27+
```
28+
29+
## Explore your experiments
30+
31+
...
32+
33+
34+
35+

native-experiment-tracking/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
zenml[server]>=0.50.0
1+
zenml[server]>=0.67.0
22
notebook
33
scikit-learn
44
pyarrow

native-experiment-tracking/run.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import click
2020

21-
from zenml.client import Client
2221
from zenml.logger import get_logger
2322

2423
from pipelines import training
@@ -46,8 +45,6 @@ def main(
4645
Args:
4746
no_cache: If `True` cache will be disabled.
4847
"""
49-
client = Client()
50-
5148
config_folder = os.path.join(
5249
os.path.dirname(os.path.realpath(__file__)),
5350
"configs",
@@ -61,7 +58,7 @@ def main(
6158
)
6259
training.with_options(**pipeline_args)()
6360
training.with_options(**pipeline_args)()
64-
logger.info("Training pipeline with SGD finished successfully!\n\n")
61+
logger.info("Training pipeline finished successfully!\n\n")
6562

6663
if __name__ == "__main__":
6764
main()

native-experiment-tracking/steps/model_evaluator.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,8 @@ def model_evaluator(
109109

110110
client = Client()
111111
mv = get_step_context().model
112-
print("got mv")
113112
m = client.list_model_versions(model_name_or_id=mv.model_id, size=1)
114-
print("got m")
115113
number_of_versions = m.total
116-
print(f"num mv {number_of_versions}")
117114

118115
# Initialize a list to store test accuracies
119116
versions = [str(mv.number)]
@@ -124,7 +121,6 @@ def model_evaluator(
124121

125122
# Fetch test accuracies until we have 10 versions or reach the start
126123
while len(versions) < 15 and index > 0:
127-
print(f"getting index: {index}")
128124
zenml_model_version = client.get_model_version("breast_cancer_classifier", index, hydrate=False)
129125
if zenml_model_version.run_metadata:
130126
test_accuracy = zenml_model_version.run_metadata['test_accuracy'].value

0 commit comments

Comments
 (0)