microsoft / MLOpsPython

MLOps using Azure ML Services and Azure DevOps
MIT License
1.19k stars 1.09k forks source link

Hyperparameter a pipeline parameter, not random value #107

Closed algattik closed 4 years ago

algattik commented 4 years ago

MLOpsPython/code/training/train.py picks a hyperparameter value randomly. This is an antipattern in 2 ways: (1) DevOps processes should yield reproducible outputs, (2) hyperparameters should be an AML pipeline parameter.

# Randomly pic alpha
alphas = np.arange(0.0, 1.0, 0.05)
alpha = alphas[np.random.choice(alphas.shape[0], 1, replace=False)][0]
dtzar commented 4 years ago

Yes, this is done for demo purposes to display something interesting on the metrics visuals. Real customer code would of course not do this.

algattik commented 4 years ago

As this repo is a starting point for MLOps projects, it would be great to show best practice in code right away.

How about making the hyperparameter value a pipeline parameter, and generating a random value for it in the devops pipeline?

dtzar commented 4 years ago

sure. PRs welcome.