0
0
ML Pythonml~10 mins

CI/CD for ML pipelines in ML Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to trigger a pipeline run on every push to the main branch.

ML Python
on:
  push:
    branches:
      - [1]
Drag options to blanks, or click blank then click option'
Adevelop
Bfeature
Cmain
Drelease
Attempts:
3 left
💡 Hint
Common Mistakes
Using a feature branch name instead of the main branch.
2fill in blank
medium

Complete the code to specify the job that runs the ML training script.

ML Python
jobs:
  train_model:
    runs-on: ubuntu-latest
    steps:
      - name: Run training
        run: python [1]
Drag options to blanks, or click blank then click option'
Atest.py
Btrain.py
Cdeploy.py
Devaluate.py
Attempts:
3 left
💡 Hint
Common Mistakes
Using evaluation or deployment scripts instead of training script.
3fill in blank
hard

Fix the error in the pipeline step that installs dependencies.

ML Python
steps:
  - name: Install dependencies
    run: pip [1] -r requirements.txt
Drag options to blanks, or click blank then click option'
Ainstall
Bdownload
Cupdate
Dupgrade
Attempts:
3 left
💡 Hint
Common Mistakes
Using pip download or pip update which do not install packages.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps dataset names to their sizes if size is greater than 1000.

ML Python
dataset_sizes = {name: size for name, size in datasets.items() if size [1] [2]
Drag options to blanks, or click blank then click option'
A>
B1000
C<
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using less than operator or wrong threshold values.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps model names in uppercase to their accuracy if accuracy is above 0.8.

ML Python
filtered_models = { [1]: [2] for model, accuracy in models.items() if accuracy [3] 0.8 }
Drag options to blanks, or click blank then click option'
Amodel.upper()
Baccuracy
C>
Dmodel.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase conversion or wrong comparison operators.