- Deep Learning By Example
- Ahmed Menshawy
- 550字
- 2025-02-23 07:57:46
Knowledge base/dataset
As we mentioned earlier, we need a historical base of data that will be used to teach the learning algorithm about the task that it's supposed to do later. But we also need another dataset for testing its ability to perform the task after the learning process. So to sum up, we need two types of datasets during the learning process:
- The first one is the knowledge base where we have the input data and their corresponding labels such as the fish images and their corresponding labels (opah or tuna). This data will be fed to the learning algorithm to learn from it and try to discover the patterns/trends that will help later on for classifying unlabeled images.
- The second one is mainly for testing the ability of the model to apply what it learned from the knowledge base to unlabeled images or unseen data, in general, and see if it's working well.
As you can see, we only have the data that we will use as a knowledge base for our learning method. All of the data we have at hand will have the correct output associated with it. So we need to somehow make up this data that does not have any correct output associated with it (the one that we are going to apply the model to).
While performing data science, we'll be doing the following:
- Training phase: We present our data from our knowledge base and train our learning method/model by feeding the input data along with its correct output to the model.
- Validation/test phase: In this phase, we are going to measure how well the trained model is doing. We also use different model property techniques in order to measure the performance of our trained model by using (R-square score for regression, classification errors for classifiers, recall and precision for IR models, and so on).
The validation/test phase is usually split into two steps:
- In the first step, we use different learning methods/models and choose the best performing one based on our validation data (validation step)
- Then we measure and report the accuracy of the selected model based on the test set (test step)
Now let's see how we get this data to which we are going to apply the model and see how well trained it is.
Since we don't have any training samples without the correct output, we can make up one from the original training samples that we will be using. So we can split our data samples into three different sets (as shown in Figure 1.9):
- Train set: This will be used as a knowledge base for our model. Usually, will be 70% from the original data samples.
- Validation set: This will be used to choose the best performing model among a set of models. Usually this will be 10% of the original data samples.
- Test set: This will be used to measure and report the accuracy of the selected model. Usually, it will be as big as the validation set.

In case you have only one learning method that you are using, you can cancel the validation set and re-split your data to be train and test sets only. Usually, data scientists use 75/25 as percentages, or 70/30.