INTRODUCTION TO MACHINE LEARNING
By: Bhanu Shahi
Tags: Machine Learning, Supervised Learning, Reinforcement Learning, Unsupervised Learning, Data Science

“A baby learns to crawl, walk and then run. We are in the crawling stage when it comes to applying machine learning.” ~Dave Waters

We are living in a world full of Humans and Machines. We the humans are learning and evolving from our past experiences for billions of years, on the other hand, the era of machines and robots has just begun.

In today’s world, these machines or robots need to be instructed to perform, but what if machines started to learn on their own and this is where machine learning comes into the picture.

In this blog, we will see the intuition behind Machine Learning and types of Machine Learning in detail.

So, let’s start with the formal understanding of Machine Learning.

What is Machine Learning?

Machine learning is a subset of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed.

ML is the core of much futuristic technological advancement in our world, today we can see various examples of machine learning around us such as Tesla’s self-driving car, Sophia AI robot, etc.

As the world is seeing digital expansion and enhancement day by day ML industry is seeing a sudden boom. Global business firms are widely adopting ML and data science for automation, increasing their profits and better management, etc.

How does Machine Learning work?

Traditionally, humans have analyzed data and adapted their culture from their past data. However, as the volume of data exceeds the ability of the human approach, it becomes necessary to quickly and automatically produce models that can analyze bigger, more complex data and deliver faster, more accurate results even on a very large scale.

For the process of learning, we need to have available some observations or data (samples) in order to explore potential underlying patterns, hidden in our data. These learned patterns are nothing more than some functions or decision boundaries.

Difference between Conventional programming and Machine Learning

In conventional programming, we feed data and programs to the computer and get the desired output.

we feed data and programs to the computer and get the desired output. In Machine Learning we feed data and output to the computer and based on that we get the required program.

Types of Machine Learning

Machine Learning is divided into three broad categories. They are:

Supervised Learning

Unsupervised Learning

Reinforcement Learning

Let’s see them one by one.

Supervised Learning

In supervised learning, we train our model on a labelled dataset which means we have both raw input data as well as its results.

We split our data into a training dataset and test dataset where the training dataset is used to train our network whereas the test dataset acts as new data for predicting results or to see the accuracy of our model.

The algorithm learns the input patterns that generate the expected output and now once the algorithm is trained it can be used to predict the correct output of an unseen input.

We can understand this from an example. Suppose we are feeding raw inputs as an image of tomato to the algorithm. We have a supervisor who keeps on correcting the machine or who keeps on training the machine that yes it is a tomato or no it is not a tomato, things like that. So this process keeps on repeating until we get a final trained model, once the model is ready it can easily predict the correct output of a never-seen input.

This model performs fast because the training time taken is less as we already have desired results in our dataset.

This model predicts accurate results on unseen data or new data without even knowing a prior target.

For each input instance an expected value associates, the value can be discreetly presenting a category or it can be real or continuous value.

Supervised models can be further grouped into regression and classification:

Regression: A regression problem is when the output variable is a real continuous value e.g. stock price prediction, house rent prediction, etc.

Classification: A classification problem is when the output variable is a category e.g. “disease” / “no disease”, “tomato” / “no tomato” etc.

Steps involved in supervised ML modeling

Supervised ML modeling consists of the following steps:

Defining the problem statement: It is the first step towards building an ML model which is necessary for getting an accurate model.

It is the first step towards building an ML model which is necessary for getting an accurate model. Pre-processing of data : This involves Cleaning the data(remove duplicates, deal with missing values, normalization, data type conversions, etc.) if required and preparing it for training.

: This involves Cleaning the data(remove duplicates, deal with missing values, normalization, data type conversions, etc.) if required and preparing it for training. Splitting the data into train and validation sets : This involves the splitting of data into training and validation sets.

: This involves the splitting of data into training and validation sets. Training the model : The goal of training is to answer a question or make a prediction correctly as often as possible.

: The goal of training is to answer a question or make a prediction correctly as often as possible. Evaluating the model : Uses some metric or combination of metrics to “measure” objective performance of the model and test the model against previously unseen data which is meant to be somewhat representative of model performance in the real world, but still helps tune the model (as opposed to testing data, which does not).

: Uses some metric or combination of metrics to “measure” objective performance of the model and test the model against previously unseen data which is meant to be somewhat representative of model performance in the real world, but still helps tune the model (as opposed to testing data, which does not). Improve the model : The sixth step is to improve the model by again going to the training state if we are not getting the required accuracy.

: The sixth step is to improve the model by again going to the training state if we are not getting the required accuracy. Deploy the model: The final step is to deploy the model and monitor real-time.

Applications of Supervised Learning

We can use regression and classification algorithms in various cases. Some of them are as follows:

Regression

Real estate prediction

Weather forecasting

Financial Portfolio prediction

Classification

Credit card fraud detection

Image classification

Spam detection

Insurance decisioning

Let’s proceed to the next one.

Unsupervised Learning

In unsupervised learning, the information used to train is neither classified nor labeled in the dataset.

Unsupervised learning studies how systems can infer a function to describe a hidden structure from unlabelled data.

The main task of unsupervised learning is to find patterns in the data.

Once a model learns to develop patterns, it can easily predict patterns for any new dataset in the form of clusters .

. The system doesn’t figure out the right output, but it explores the data and can draw inferences from datasets to describe hidden structures from unlabeled data.

As we have already discussed that in unsupervised learning our dataset is not labeled, So if we are feeding apple, avocado, and orange as raw input data then our model will distinguish all three but it cannot tell whether a given cluster is of apple or not as it is unlabelled but any new data will automatically fit into the clusters that are formed.

“Clustering” is the process of grouping similar entities together. The goal of this unsupervised machine learning technique is to find similarities in the data point and group similar data points together.

Applications of Unsupervised Learning

We are using unsupervised learning methods in the following cases:

Document identification

Customer segmentation

Insurance fraud detection

Delivery store optimization

Reinforcement learning

The third type of machine learning technique is reinforcement learning.

It is neither based on supervised learning nor unsupervised learning.

Here the algorithms learn to react to an environment on their own.

It is rapidly growing and moreover producing a variety of learning algorithms.

These algorithms are useful in the field of Robotics, Gaming, etc.

In reinforcement learning, there is a learning agent for which, there is always a start state and an end state.

In Reinforcement Learning Problem an agent tries to manipulate the environment.

The agent travels from one state to another.

To reach the end state, there might be a different path.

The agent gets the reward(appreciation) for success but will not receive any reward or appreciation for failure.

In this way, the agent learns from the environment.

Let’s understand the reinforcement learning mechanism from the below example.

Consider the scenario of teaching new tricks to your Dog.

First, the trainer issues a command, which the dog observes and tries to respond to in many different ways.

If the dog’s response is close to the desired behavior, the trainer will give some reward like food to it.

Now whenever the dog is exposed to the same situation, it executes a similar action even more enthusiastically in expectation of getting more reward(food).

In this way, the dog learns “what to do” from positive experiences.

At the same time, the dog also learns “what not to do” when faced with negative experiences.

We can understand how Reinforcement Learning works from the above example.

In this case, the dog is an agent that is exposed to the environment. An example of a state could be our dog sitting, and we use a specific word for the dog to walk. Our agent reacts by performing an action transition from one “state” to another “state.” For example, Our dog goes from sitting to walking. After the transition, it may get a reward or penalty in return.

Applications of Reinforcement learning

We can use reinforcement learning algorithms in the following cases:

Traffic light control

Resource Management

Robotics

Games

Self-driving cars

Conclusion

Machine learning uses algorithms to parse data, learn from that data, and make informative decisions based on what it has learned.

To sum up, we can say that,

In Supervised Learning , the goal is to generate a formula based on input and output values.

, the goal is to generate a formula based on input and output values. In Unsupervised Learning , we find an association between input values and group them.

, we find an association between input values and group them. In Reinforcement Learning an agent learn through delayed feedback by interacting with the environment.

That’s all in this blog. I will extend this further in the upcoming blogs.