Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to define a pipeline task using a decorator.
MLOps
@pipeline def my_pipeline(): @[1] def preprocess(): pass
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using @step or @job which are not standard task decorators here.
✗ Incorrect
The @task decorator defines a pipeline task in many MLOps frameworks.
2fill in blank
mediumComplete the code to create a Directed Acyclic Graph (DAG) for pipeline execution.
MLOps
with DAG('[1]', schedule_interval='@daily') as dag: pass
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic names like 'pipeline_dag' which may not match the pipeline.
✗ Incorrect
The DAG name is often the pipeline name, here my_pipeline.
3fill in blank
hardFix the error in the task dependency definition to ensure correct execution order.
MLOps
preprocess = task1()
train = task2()
train [1] preprocess Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<<' which reverses the order causing errors.
✗ Incorrect
The >> operator sets train to run after preprocess.
4fill in blank
hardFill both blanks to define a pipeline component with input and output.
MLOps
def preprocess(data: [1]) -> [2]: # process data pass
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing input/output with data types like Dataset or Model.
✗ Incorrect
The input type is Input and the output type is Output in pipeline components.
5fill in blank
hardFill all three blanks to create a pipeline step that runs a training component with parameters.
MLOps
train_step = [1]( model_name=[2], epochs=[3] )
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using pipeline name instead of component for first blank.
Putting number as string for epochs.
✗ Incorrect
The training step calls train_component with model name 'resnet50' and epochs 10.