-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow.py
More file actions
28 lines (23 loc) · 721 Bytes
/
workflow.py
File metadata and controls
28 lines (23 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from kfp import dsl
import mlrun
@dsl.pipeline(name="Breast Cancer Classifier Pipeline")
def pipeline():
project = mlrun.get_current_project()
data_prep = project.run_function(
"Data-prep",
outputs=["dataset"]
)
train = project.run_function(
"trainer",
outputs=["model"],
inputs={"dataset": data_prep.outputs["dataset"]},
hyperparams={
"n_estimators": [10, 100, 200],
"max_depth": [2, 5, 10]
},
selector="max.accuracy",
)
deploy = mlrun.deploy_function(
"serving",
models=[{"key": "my_model", "model_path": train.outputs["model"], "class_name": "ClassifierModel"}],
)