ML Unit 1
ML Unit 1
ML Unit 1
Unit:1
1. Machine Learning (ML)
Introduction
Machine learning is one of the most exciting technologies that one would have ever come across.
As it is evident from the name, it gives the computer that which makes it more similar to humans:
The ability to learn. Machine learning is actively being used today, perhaps in many more places
than one would expect. We probably use a learning algorithm dozens of time without even knowing
it.
Definition: “Machine Learning (ML) is a Field of study that gives computers the capability to
learn without being explicitly programmed”.
• In a very layman manner, Machine Learning(ML) can be explained as automating and
improving the learning process of computers based on their experiences without being actually
programmed i.e. without any human assistance.
• The process starts with feeding good quality data and then training our machines(computers)
by building machine learning models using the data and different algorithms.
• The choice of algorithms depends on what type of data do we have and what kind of task we
are trying to automate.
Example:
Training of students during exam.
While preparing for the exams students don’t actually cram the subject but try to learn it
with complete understanding. Before the examination, they feed their machine(brain) with a good
amount of high-quality data (questions and answers from different books or teachers notes or
online video lectures). Actually, they are training their brain with input as well as output i.e. what
kind of approach or logic do they have to solve a different kind of questions. Each time they solve
practice test papers and find the performance (accuracy /score) by comparing answers with answer
key given, Gradually, the performance keeps on increasing, gaining more confidence with the
adopted approach.
That’s how actually models are built, train machine with data (both inputs and outputs are
given to model) and when the time comes test on data (with input only) and achieves our model
scores by comparing its answer with the actual output which has not been fed while training.
Researchers are working with assiduous efforts to improve algorithms, techniques so that these
models perform even much better.
Even in health care also, ML is doing a fabulous job. Researchers and scientists have prepared
models to train machines for detecting cancerjust by looking at slide – cell images. For humans to
perform this task it would have taken a lot of time. But now, no more delay, machines predict the
chances of having or not having cancer with some accuracy and doctors just have to give an
assurance call, that’s it. The answer to – how is this possible is very simple -all that is required, is,
high computation machine, a large amount of good quality image data, ML model with good
algorithms to achieve state-of-the-art results.
Doctors are using ML even to diagnose patients based on different parameters under consideration.
You all might have use IMDB ratings, Google Photos where it recognizes faces, Google Lens
where the ML image-text recognition model can extract text from the images you feed in, Gmail
which categories E-mail as social, promotion, updates or forum using text classification,which is a
part of ML.
Web Search Engine: One of the reasons why search engines like google, bing etc work so well is
because the system has learnt how to rank pages through a complex learning algorithm.
Photo tagging Applications: Be it facebook or any other photo tagging application, the ability to tag
friends makes it even more happening. It is all possible because of a face recognition algorithm that
runs behind the application.
Spam Detector: Our mail agent like Gmail or Hotmail does a lot of hard work for us in classifying
the mails and moving the spam mails to spam folder. This is again achieved by a spam classifier
running in the back end of mail application.
Today, companies are using Machine Learning to improve business decisions,increase productivity,
detect disease, forecast weather, and do many more things. With the exponential growth of
technology, we not only need better tools to understand the data we currently have, but we also
need to prepare ourselves for the data we will have. To achieve this goal we need to build
intelligent machines. We can write a program to do simple things. But for most of times
Hardwiring Intelligence in it is difficult. Best way to do it is to have some way for machines to
learn things themselves. A mechanism for learning – if a machine can learn from input then it
Machine learning implementations are classified into three major categories, depending on the
nature of the learning “signal” or “response” available to a learning system which are as follows:-
A machine is said to be learning from past Experiences(data feed in) with respect to some class of
Tasks, if it’s Performance in a given Task improves with the Experience. Supervised learning is
when the model is getting trained on a labelled dataset. Labelled dataset is one which have both
input and output parameters. In this type of learning both training and validation datasets are
labelled as shown in the figures below.
Linear Regression
Nearest Neighbor
Decision Trees
Random Forest
2.Unsupervised learning
Whereas when an algorithm learns from plain examples without any associated response, leaving
to the algorithm to determine the data patterns on its own. This type of algorithm tends to
restructure the data into something else, such as new features that may represent a class or a new
series of un-correlated values. They are quite useful in providing humans with insights into the
meaning of data and new useful inputs to supervised machine learning algorithms.
As a kind of learning, it resembles the methods humans use to figure out that certain objects or
events are from the same class, such as by observing the degree of similarity between objects.
Some recommendation systems that you find on the web in the form of marketing automation are
based on this type of learning.
Unstructured data: May contain noisy(meaningless) data, missing values or unknown data
Unlabeled data : Data only contains value for input parameters, there is no targeted
value(output). It is easy to collect as compared to labelled one in Supervised approach.
Clustering: Broadly this technique is applied to group data based on different patterns, our
machine model finds. For example in above figure we are not given output parameter value,
so this technique will be used to group clients based on the input parameters provided by our
data.
Association: This technique is a rule based ML technique which finds out some very useful
relations between parameters of a large data set. For e.g. shopping stores use algorithms based
on this technique to find out relationship between sale of one product w.r.t to others sale based
on customer behavior. Once trained well, such models can be used to increase their sales by
planning different offers.
Some algorithms:
K-Means Clustering
Hierarchical Clustering
3.Reinforcement learning
As the name suggests, its working lies between Supervised and Unsupervised techniques. We use
these techniques when we are dealing with a data which is a little bit labelled and rest large portion
of it is unlabeled. We can use unsupervised technique to predict labels and then feed these labels to
supervised techniques. This technique is mostly applicable in case of image data-sets where usually
all images are not labelled.
When you present the algorithm with examples that lack labels, as in unsupervised learning.
However, you can accompany an example with positive or negative feedback according to the
solution the algorithm proposes comes under the category of Reinforcement learning, which is
connected to applications for which the algorithm must make decisions (so the product is
In this technique, model keeps on increasing its performance using a Reward Feedback to learn the
behavior or pattern. These algorithms are specific to a particular problem e.g. Google Self Driving
car, AlphaGo where a bot competes with human and even itself to getting better and better
performer of Go Game. Each time we feed in data, they learn and add the data to its knowledge that
is training data. So, more it learns the better it get trained and hence experienced.
After its performance, agent receives reward and accordingly reinforce and the model stores in
state-action pair of information.
Some algorithms:
Q-Learning
Example : The problem is as follows: We have an agent and a reward, with many hurdles in
between. The agent is supposed to find the best possible path to reach the reward. The following
problem explains the problem more easily.
The above image shows robot, diamond and fire. The goal of the robot is to get the reward that is
the diamond and avoid the hurdles that is fire. The robot learns by trying all the possible paths and
then choosing the path which gives him the reward with the least hurdles. Each right step will give
the robot a reward and each wrong step will subtract the reward of the robot. The total reward will
be calculated when it reaches the final reward that is the diamond.
Input: The input should be an initial state from which the model will start
Output: There are many possible output as there are variety of solution to a particular problem
Maximizes Performance
Increases Behavior