When we develop a supervised machine learning model, no matter what algorithm is involved — regression or classification — training and testing are two of the most important parts of the process.
Training
The process of training puts the "learning" in machine learning. During this step, we provide our model with both the input and output data, which then allows it to learn correlations between the inputs and the output so that predictions can be made in the future. In the case of regression, this would involve fitting the ideal curve through the data. We will be using training data during this step to train the algorithm, and since we're working on supervised learning, remember that we'll also be providing it with the correct outputs in the training data.
Testing
As the name suggests, this step will test our machine learning model by evaluating the accuracy of our model, giving us an indication of how effective it is. In this step, we only give our model input data, asking it to predict the outputs. We can then use evaluation metrics (which will be discussed in the future) to compare the model's predictions with the actual values. Don't worry if this is too abstract right now, there's more notebooks in this chapter that will give you a better intuition.
Next Section
4.2 Overfitting and UnderfittingCopyright © 2021 Code 4 Tomorrow. All rights reserved.
The code in this course is licensed under the MIT License.
If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact classes@code4tomorrow.org for inquiries.