Complete the code to run model validation using a CI pipeline step.
steps:
- name: Validate Model
run: python validate_model.py --model [1]The validation script requires the model file, which is typically named model.pkl.
Complete the code to check if model accuracy meets the threshold before promotion.
if accuracy [1] 0.85: print('Model passed validation') else: print('Model failed validation')
The model should pass validation if accuracy is greater than or equal to 0.85.
Fix the error in the validation script to correctly load the model file.
with open('[1]', 'rb') as f: model = pickle.load(f)
The model file is a binary pickle file, so it should be model.pkl.
Fill both blanks to create a dictionary comprehension that filters models with accuracy above 0.9.
high_accuracy_models = {model[1]: acc for model, acc in results.items() if acc [2] 0.9}We convert model names to uppercase and select those with accuracy greater than 0.9.
Fill all three blanks to create a dictionary of models with accuracy above 0.8 and keys as lowercase model names.
validated_models = { [1]: [2] for [3] in results.items() if [2] > 0.8}The dictionary keys are lowercase model names, values are accuracies, iterating over model, acc pairs.