0
0
ML Pythonml~20 mins

CI/CD for ML pipelines in ML Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ML CI/CD Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding CI/CD stages in ML pipelines

Which stage in a CI/CD pipeline for ML is responsible for automatically retraining the model when new data arrives?

AModel deployment stage
BContinuous training stage
CContinuous integration stage
DMonitoring stage
Attempts:
2 left
💡 Hint

Think about which stage updates the model with fresh data.

💻 Command Output
intermediate
2:00remaining
Output of a pipeline status command

What is the output of the command mlflow pipelines status --pipeline-name churn-prediction if the pipeline is currently running?

ML Python
mlflow pipelines status --pipeline-name churn-prediction
APipeline 'churn-prediction' status: RUNNING
BError: Pipeline not found
CPipeline 'churn-prediction' status: FAILED
DNo pipelines currently running
Attempts:
2 left
💡 Hint

Look for the status message indicating the pipeline is active.

Configuration
advanced
2:00remaining
Correct YAML snippet for triggering retraining

Which YAML snippet correctly configures a GitHub Actions workflow to trigger model retraining on every push to the main branch?

ML Python
name: ML Retrain
on:
  push:
    branches:
      - main
jobs:
  retrain:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run retrain script
        run: python retrain.py
A
on:
  schedule:
    - cron: '0 0 * * *'
B
on:
  pull_request:
    branches:
      - main
C
on:
  push:
    branches:
      - main
D
on:
  push:
    tags:
      - main
Attempts:
2 left
💡 Hint

Look for the event that triggers on code push to the main branch.

Troubleshoot
advanced
2:00remaining
Diagnosing failed model deployment

You have a CI/CD pipeline that builds and deploys an ML model. The build succeeds but deployment fails with the error: Permission denied: unable to push to model registry. What is the most likely cause?

AThe model artifact is missing from the build
BThe deployment script has a syntax error
CThe model registry service is down
DThe CI/CD pipeline lacks permissions to write to the model registry
Attempts:
2 left
💡 Hint

Consider access rights needed for deployment.

🔀 Workflow
expert
3:00remaining
Order of steps in a CI/CD ML pipeline

Arrange the following steps in the correct order for a typical CI/CD pipeline for ML models:

  1. Deploy model to production
  2. Run automated tests on model code
  3. Train model with new data
  4. Build model artifact
A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,2,1,4
Attempts:
2 left
💡 Hint

Think about testing before training, then building, then deploying.