Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Manage source control for machine learning projects by using Git

A worked example

Yes or no

A team is moving a diabetes classification project from one data scientist's laptop into a private GitHub repository that the whole team can read. The project currently contains:

  • src/train.py: the training script
  • jobs/train-job.yml: an Azure Machine Learning command job definition
  • config/workspace.env: a text file that holds the Azure Machine Learning workspace name, the resource group name and the compute cluster name used by the team's automation
  • data/diabetes.csv: a 2 GB copy of the training data

The team also plans to authenticate its automation by using a service principal client secret.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

StatementYesNo
The config/workspace.env file, with the workspace name, resource group name and compute cluster name, should be committed to the Git repository.

Configuration files that hold workspace names, resource group names, compute names and similar references used by automation are listed as assets that belong in Git. They are text-based and define how the model is produced.

Correct
To support reproducible training runs, data/diabetes.csv should be committed to the Git repository together with src/train.py.

Datasets and raw data do not belong in Git. They should be stored as Azure Machine Learning data assets or in Azure Data Lake Storage, because data files are large and versioned separately from code. Reproducibility comes from the recorded code and environment definitions.

Correct
Because the repository is private, the service principal client secret can be stored in config/workspace.env next to the workspace name.

Secrets and credentials belong in GitHub secrets or Azure Key Vault. Any credential placed in a repository is exposed to everyone with read access, and a private repository still has readers, which here is the whole team.

Correct
Why

A practical rule is that text files defining how the model is produced belong in Git. This includes scripts, job definitions, environment files and configuration files with resource identifiers such as workspace, resource group and compute names. Large data files belong in Azure Machine Learning data assets or Azure Data Lake Storage, which are versioned separately from code. Credentials belong in GitHub secrets or Azure Key Vault, because anyone with read access to a repository can see what it contains.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free