Introduction to Machine Learning
Traditional Programming vs Machine Learning
Traditional Programming
Traditional Programming is the art of automating tasks by writing rules for the computer to follow.
For Example:
Let us suppose we have a list of numbers X = [1, 20, 13, 42, 56, 6]
We want the desired output to be Y = [3, 22, 15, 44, 58, 8]
In traditional programming, we write the program as “Y = X + 2”.
Machine Learning
Machine Learning gives the ability to learn without being explicitly programmed.
For example:
Let us suppose we have a list of numbers X = [1, 20, 13, 42, 56, 6]
We want the desired output to be Y = [3, 22, 15, 44, 58, 8]
In the machine learning setup, we feed the X and Y to the computation block and it will learn the program as “Y = X + 2”.
When we prefer Machine Learning
We prefer the machine learning system when we couldn’t come up with or quite difficult to come up with an algorithm that maps the input to the output.
For example:
Let us suppose we want to classify whether the input image is a cat or a dog. For us, it is quite difficult to come up with the exact feature sets (eg, the color of skin, size of the ear, tail length, and so on) which robustly classify the input image. Due to this, we feed the input images and expected labels to the computation block, and the computation block outputs the algorithm that robustly classifies the input images.
So, for this problem, we prefer the Machine Learning approach over the Traditional Programming approach.
Types of Machine Learning
Supervised Learning
Learning the mapping function from input to output. Data has both input and output labels. It has two categories:
Classification: Learning the mapping function from input to discrete output.
In this example, we are mapping the input image to either the “Cat” or “Dog” label.
Regression: Learning the mapping function from input to continuous output.
In this example, we are mapping the input house image to its price value.
Unsupervised Learning
Learning the underlying structure of the data. Only input data is available. It has two categories:
Clustering: Learning the inherent groupings in the data.
In this example, we are clustering the collection of input images (containing houses and animal images) into two clusters.
Dimensionality Reduction: Reducing the dimensionality of data while maintaining its structure and usefulness.
In this example, we are reducing the number of dimensions to represent the input dog image to the lower number of dimensions while preserving its structure and important features.
Reinforcement Learning
The learner is not told which action to take but instead must discover which action will yield the maximum reward.
In this example, Dog learns to perform the standing action basis on the reward that we provide. Here we are not telling Dog how to stand.