Scroll to read more

Training a model is the “fun” part of machine learning, but it can only occur once we have prepared our dataset.

The first step is to determine the machine learning category: supervised, unsupervised, or reinforcement learning, based on our training data.

Next, we determine the sub-task, which could be classification or regression for supervised learning, or clustering & dimensionality reduction for unsupervised.

Finally, we select the best algorithm based on our task.  It is common to try multiple and compare performance across multiple metrics.

Now we begin the “training”, by repeating some mathematical process on our data until “convergence”.

Example of the steps taken by KNN

However, we must take care to avoid underfitting or overfitting, which prevents the model from generalizing accurately to new data, which is the whole point of training a model!

For maximum performance, we can try to refine the model through “hyperparameter tuning”, where we change details of the training process, to hopefully improve the accuracy of the final model. There are curated approaches to do this efficiency.

Training is often time consuming, expensive, and requires huge amounts of data. (Especially for Deep Learning!)  We can apply shortcuts such as “transfer learning” to significantly speed up this process.