While most of this book has focused on how to write and use ML code, you will have also noticed that a lot of traditional, non-ML code is needed to support what we have done. Much of this is hidden inside the software libraries we have used, but there are cases where you may need to add to this.
One example is where you need to enforce certain constraints on your model output, for instance, to handle an edge case or implement some safety-critical constraints. Suppose you are writing software for a self-driving car: you might use ML to process image data from the cars cameras, but when it comes to actuating the vehicles steering, engine, and brake controls, you will most likely need to use traditional code to ensure that the car is controlled safely. Similarly, unless your ML system is trained to handle unexpected data inputs, for example...