Supervised Learning
Supervised learning is one of the most basic types of machine learning. In this type, the machine learning algorithm is trained on labeled data. Even though the data needs to be labeled accurately for this method to work, supervised learning is extremely powerful when used in the right circumstances.
Basically supervised learning is when we teach or train the machine using data that is well labelled. Which means some data is already tagged with the correct answer. It’s like showing a child something and telling them what it is, so they can recognize it in the future.
This means that supervised machine learning algorithms will continue to improve even after being deployed, discovering new patterns and relationships as it trains itself on new data.
Unsupervised Learning
Unsupervised learning is the training of a machine using information that is neither classified nor labeled and allowing the algorithm to act on that information without guidance. This means that human labor is not required to make the dataset machine-readable, allowing much larger datasets to be worked on by the program.
In supervised learning, the labels allow the algorithm to find the exact nature of the relationship between any two data points. However, unsupervised learning does not have labels to work off of, resulting in the creation of hidden structures.
You give the program a dataset, but no instructions on what the dataset means. You’re not defining any kind of outcome for the algorithm. Instead, it needs to figure out the patterns (if there are any) on its own.
Reinforcement Learning
Reinforcement Learning is learning by interacting with an environment. An RL agent learns from the consequences of its actions, rather than from being explicitly taught and it selects its actions on basis of its past experiences (exploitation) and also by new choices (exploration), which is essentially trial and error learning.
Think of your pet dog. You would give the dog a reward if he does what you want it to do and a small penalty/punishment for something he shouldn’t do. That way, the dog learns to never make the same mistake again.
Now that we’ve understood what the three main methods of learning are, we can proceed on to training a model.
Training a model
The process of training an ML model involves providing an ML algorithm (that is, the learning algorithm) with training data to learn from. The term ML model refers to the model artifact that is created by the training process.
The model takes input in the form of data (x) and generates an output (y) based on the input data and its parameters. The optimisation algorithm tries to find the best combination of parameters so that given the example x the model’s output y is as close to the expected output as possible. The trained model will represent a specific function f that given x produces output y. So: y=f(x).
For example, let’s say that you want to train an ML model to predict if an email is spam or not spam. You would provide the ML with training data that contains emails for which you know the target (that is, a label that tells whether an email is spam or not spam). Then we would train an ML model by using this data, resulting in a model that attempts to predict whether new email will be spam or not spam.
There’s 3 types of models, Binary Classification, Multiclass Classification & Regression models.