0% found this document useful (0 votes)
9 views

Unit 1 Introduction To Machine Learning

Uploaded by

parthpanchal2207
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Unit 1 Introduction To Machine Learning

Uploaded by

parthpanchal2207
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Introduction to Machine

Learning
Unit 1

AML-Prof. Minal Chauhan


Machine Learning-where did it started?
• As of today, machine learning is a mature technology area finding its
application in almost every sphere of life.
• It predicts the future market to help amateur traders compete with
seasoned stock traders.
• It helps an oncologist find whether a tumor is malignant or benign.
• It helps in optimizing energy consumption thus helping the cause of Green
Earth.
• Google has become one of the front-runners focusing a lot of its research
on machine learning and artificial intelligence – Google self-driving car and
Google Brain being two most ambitious projects of Google in its journey of
innovation in the field of machine learning.
• In a nutshell, machine learning has become a way of life, no matter
whichever sphere of life we closely look at. But where did it all start from?
When/by whom did it started?
• The foundation of machine learning started in the 18th and 19th centuries.
The first related work dates back to 1763. In that year, Thomas Bayes’s
work ‘An Essay towards solving a Problem in the Doctrine of Chances’ was
published two years after his death. This is the work underlying Bayes
Theorem, a fundamental work on which a number of algorithms of
machine learning is based upon.
• In 1812, the Bayes theorem was actually formalized by the French
mathematician Pierre Simon Laplace.
• In 1913, Andrey Markov came up with the concept of Markov chains.
• However, the real start of focused work in the field of machine learning is
considered to be Alan Turing’s seminal work in 1950. In his paper
‘Computing Machinery and Intelligence. Turing posed the question ‘Can
machines think?’ or in other words, ‘Do machines have intelligence?’.
Can machine learn?
• The big question is can machines learn better than human?
• To find its answer, the first step would be to understand what learning
is from a human perspective.
• We need to know whether machine learning has already surpassed or
has the potential to surpass human learning in every facet of life.
What is human learning?
• In cognitive science, learning is typically referred to as the process of
gaining information through observation.
• And why do we need to learn?
• In our daily life, we need to carry out multiple activities. It may be
simple or complex task.
• To do a task in a proper way, we need to have prior information on
one or more things related to the task.
• Also, as we keep learning more or in other words acquiring more
information, the efficiency in doing the tasks keep improving.
Types of Human learning
• human learning happens in one of the three ways –
1. either somebody who is an expert in the subject directly teaches us
2. we build our own notion indirectly based on what we have learnt
from the expert in the past
3. we do it ourselves, may be after multiple attempts, some being
unsuccessful
1. Learning under expert guidance
• In first phase of life we say that the baby ‘learns’ things from his parents.
• The next phase of life is when the baby starts going to school and learns
how to form words from the alphabets and numbers from the digits. Slowly
more complex learning happens in the form of sentences, paragraphs,
complex mathematics, science, etc.
• Then starts higher studies where the person learns about more complex,
application-oriented skills. Engineeringstudents get skilled in one of the
disciplines
• Then the person starts working as a professional in some field. He still
needs to learn more about the hands-on application of the knowledge that
he has acquired.
• guided learning is the process of gaining information from a person having
sufficient knowledge due to the past experience.
2. Learning guided by knowledge gained from
experts
• An essential part of learning also happens with the knowledge which
has been imparted by teacher or mentor at some point of time in
some other form/context.
• For example, a baby can group together all objects of same colour
even if his parents have not specifically taught him to do so.
• A grown-up kid can select one odd word from a set of words because
it is a verb and other words being all nouns.
• In all these situations, there is no direct learning. It is some past
information shared on some different context, which is used as a
learning to make decisions.
3. Learning by self
• In many situations, humans are left to learn on their own. A classic
example is a baby learning to walk through obstacles. He bumps on to
obstacles and falls down multiple times till he learns that whenever
there is an obstacle, he needs to cross over it.
• He faces the same challenge while learning to ride a cycle as a kid or
drive a car as an adult.
• Not all things are taught by others. A lot of things need to be learnt
only from mistakes made in the past.
• We tend to form a check list on things that we should do, and things
that we should not do, based on our experiences.
What is machine learning?
• Do machines really learn?
• If so, how do they learn?
• Which problem can we consider as a well-posed learning problem?
• What are the important features that are required to well-define a
learning problem?
The Defination
• Tom M. Mitchell, Professor of Machine Learning Department, School of
Computer Science, Carnegie Mellon University. Tom M. Mitchell has
defined machine learning as
• ‘A computer program is said to learn from experience E with respect to
some class of tasks T and performance measure P, if its performance at
tasks in T, as measured by P, improves with experience E.’
• machine can be considered to learn if it is able to gather experience by
doing a certain task and improve its performance in doing the similar tasks
in the future.
• When we talk about past experience, it means past data related to the
task. This data is an input to the machine from some source.
Why “Learn” ?
• Machine learning is programming computers to optimize a
performance criterion using example data or past experience.
• There is no need to “learn” to calculate payroll
• Learning is used when:
• Human expertise does not exist (navigating on Mars),
• Humans are unable to explain their expertise (speech recognition)
• Solution changes in time (routing on a computer network)
• Solution needs to be adapted to particular cases (user biometrics)

13
Machine learning process
• The basic machine learning process can be divided into three parts.
1. Data Input: Past data or information is utilized as a basis for future
decision-making
2. Abstraction: The input data is represented in a broader way through
the underlying algorithm
3. Generalization: The abstracted representation is generalized to form
a framework for making decisions
Let’s consider the situation
• Typical process of learning from classroom and books and preparing
for the examination
• It is a tendency of many students to try and memorize: may work well
for simple questions and scope of learning is not so vast
• Questions asked in the examination gets more complex and scope
gets broader
• The number of topics may get too vast memorize also, the capability
of memorizing varies from student to student
• In the case of human learning is that just by great memorizing and
perfect recall, i.e. just based on knowledge input
So what’s learning strategy?
• Students can do well in the examinations only till a certain stage, beyond
that, a better learning strategy needs to be adopted
• to be able to deal with the vastness of the subject matter and the related issues in
memorizing it
• to be able to answer questions where a direct answer has not been learnt
• A good option is to figure out the key points or ideas amongst a vast pool
of knowledge.
• This helps in creating an outline of topics and a conceptual mapping of
those outlined topics with the entire knowledge pool.
• For example, a broad pool of knowledge may consist of all living animals
and their characteristics like invertebrates and vertebrates.
Classification: Animals
1. Invertebrate: Do not have backbones and skeletons
2. Vertebrate
1. Fishes: Always live in water and lay eggs
2. Amphibians: Semi-aquatic i.e. may live in water or land; smooth skin; lay eggs
3. Reptiles: Semi-aquatic like amphibians; scaly skin; lay eggs; cold-blooded
4. Birds: Can fly; lay eggs; warm-blooded
5. Mammals: Have hair or fur; have milk to feed their young; warm-blooded
Machine Learning Terminology
• The vast pool of knowledge is available from the data input.
• a concept map, like the animal group to characteristic mapping explained
above, is drawn from the input data.
• This is nothing but knowledge abstraction as performed by the machine.
• In the end, the abstracted mapping from the input data can be applied to
make critical conclusions.
• For example, if the group of an animal is given, understanding of the
characteristics can be automatically made. Reversely, if the characteristic of
an unknown animal is given, a definite conclusion can be made about the
animal group it belongs to. This is generalization in context of machine
learning.
Step 1: Model
• During the machine learning process, knowledge is fed in the form of input
data.
• Data cannot be used in the original shape and form.
• Abstraction helps in deriving a conceptual map based on the input data.
• This map, or a model as it is known in the machine learning paradigm, is
summarized knowledge representation of the raw data. The model may be
in any one of the following forms
• Computational blocks like if/else rules
• Mathematical equations
• Specific data structures like trees or graphs
• Logical groupings of similar observations
Which model to choose?
• The decision related to the choice of model is taken based on multiple
aspects:
• The type of problem to be solved
• Nature of the input data
• Domain of the problem
Step 2: Training the model
• Next task is to fit the model based on the input data.
• In a case where the model is represented by a mathematical equation, ‘y =
c1 + c2 x’, based on the input data, we find the values of c1 and c2 .
• Otherwise, the equation (or the model) is of no use.
• So, fitting the model, in this case, means finding the values of the unknown
coefficients or constants of the equation or the model.
• This process of fitting the model based on the input data is known as
training.
• The input data based on which the model is being finalized is known as
training data.
The two steps:
• Abstraction:
• The first part of machine learning process is abstraction i.e. abstract the
knowledge which comes as input data in the form of a model.
• Abstraction process, or more popularly training the model, is just one part of
machine learning.
• Generalization:
• The other key part is to tune up the abstracted knowledge to a form which
can be used to take future decisions. This is achieved as a part of
generalization.
• This part is quite difficult to achieve. This is because the model is trained
based on a finite set of data, which may possess a limited set of
characteristics.
Problems with decision making
1. The trained model is aligned with the training data too much, hence
may not portray the actual trend.
2. The test data possess certain characteristics apparently unknown to
the training data.
An approximate or heuristic approach:
• gut feeling-based decision-making in human where exact reason-based
decision-making is not possible
• risk of not making a correct decision – quite obviously because certain
assumptions that are made may not be true in reality
The learning problem
• Step 1: What is the Problem?
• A number of information should be collected to know what is the problem.
• Informal description of the problem, e.g. I need a program that will prompt
the next word as and when I type a word
• For example:
• Task (T): Prompt the next word when I type a word.
• Experience (E): A corpus of commonly used English words and phrases.
• Performance (P): The number of correct words prompted considered as a
percentage (which in machine learning paradigm is known as learning
accuracy).
The learning problem
• Step 2: Why does the problem need to be solved?
• What is the motivation for solving the problem? What requirement will it
fulfil?
• For example, does this problem solve any long-standing business issue like
finding out potentially fraudulent transactions? Or the purpose is more trivial
like trying to suggest some movies for upcoming weekend.
• It is important to clearly understand the benefits of solving the problem.
These benefits can be articulated to sell the project.
• How will the solution to the problem be used and the life time of the solution
is expected to have?
The learning problem
• Step 3: How would I solve the problem?
• Try to explore how to solve the problem manually.
• Detail out step-by-step data collection, data preparation, and program design
to solve the problem.
• Collect all these details and update the previous sections of the problem
definition, especially the assumptions.
Summary
Step 1: What is the problem? Describe the problem informally and
formally and list assumptions and similar problems.
Step 2: Why does the problem need to be solved? List the motivation
for solving the problem, the benefits that the solution will provide and
how the solution will be used.
Step 3: How would I solve the problem? Describe how the problem
would be solved manually to flush domain knowledge.
Types of machine learning
Supervised Learning
• For example, there may be a very high correlation between the number of
salespeople employed by a company, the number of stores they operate,
and the revenue the business generates.
• Training data: This basic input or the experience
• The machine builds a predictive model that can be used on test data to
assign a label for each record in the test data
• Prediction of future cases: Use the rule to predict the output for future
inputs
• Knowledge extraction: The rule is easy to understand
• Compression: The rule is simpler than the data it explains
• Outlier detection: Exceptions that are not covered by the rule, e.g., fraud
29
Supervised Learning
Classification
• Example: Credit scoring
• Differentiating between
low-risk and high-risk
customers from their
income and savings

Discriminant: IF income > θ1 AND savings > θ2


THEN low-risk ELSE high-risk

31
Classification
Classification: Applications
• Finding similarities aka Pattern recognition
• Face recognition: Pose, lighting, occlusion (glasses, beard), make-up,
hair style
• Character recognition: Different handwriting styles.
• Speech recognition: Temporal dependency.
• Medical diagnosis: From symptoms to illnesses
• Biometrics: Recognition/authentication using physical and/or
behavioral characteristics: Face, iris, signature, etc
• Outlier/novelty detection:
33
Face Recognition
Training examples of a person

Test images

ORL dataset,
AT&T Laboratories, Cambridge UK

34
Regression

• Example: Price of a used car


• x : car attributes
y = wx+w0
y : price
y = g (x | q )
g ( ) model(function),
q (unknown)parameters

35
Regression Applications
• Navigating a car: Angle of the steering
• Kinematics of a robot arm
• For example, there may be a very high correlation between the number of
salespeople employed by a company, the number of stores they operate, and
the revenue the business generates.
(x,y) α1= g1(x,y)
α2= g2(x,y)
α2

α1

◼ Response surface design


36
Unsupervised Learning
• Also called descriptive learning. A machine finds patterns in unknown
objects by grouping similar objects together.
• Descriptive model
• Process of unsupervised learning is referred as pattern discovery or
knowledge discovery
• Learning “what normally happens”
• Clustering: Grouping similar instances
• Example applications
• Customer segmentation in CRM
• Image compression: Color quantization
• Bioinformatics: Learning motifs

37
Unsupervised Learning
Clustering
Associations
• Market Basket analysis:
P (Y | X ) probability that somebody who buys X also buys Y where X
and Y are products/services.

Example: P ( milk | eggs ) = 0.7

40
Reinforcement Learning
• A machine learns to act on its own to achieve the given goals
• Machines often learn to do tasks autonomously
• Learning a policy: A sequence of outputs
• No supervised output but delayed reward
• When a sub-task is accomplished successfully, a reward is given.
• Game playing
• Robot in a maze
• Multiple agents, partial observability, etc..

41
Reinforcement Learning
Applications of machine learning
• Banking and finance
• Insurance
• Healthcare
Tools in machine learning
• Python
•2R
• Matlab
• SAS
Problems in ML
• Data quality
• The complexity and quality trade-off
• Sampling bias in data
• Changing expectations and concept drift
• Monitoring and maintenance

You might also like