![]() ![]() |
Conceptual Review (page 45 of 55) |
We use custom functions to organize our code. We specifically like to use functions for code that we will have to execute in multiple spots in our scripts. If we find ourselves copying & pasting code, then that code is a great candidate to write within a function.
Functions help break our program (scripts) up into smaller or modular chunks. As our scripts grow larger and larger, functions can make them more organized, readable, manageable, and maintainable.

For instance, we can use functions for the code that evaluates the performance of our machine learning models. We can then call the function for each trained machine learning model to facilitate comparing performance.