0% found this document useful (0 votes)
16 views30 pages

Machine Learning - v1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views30 pages

Machine Learning - v1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Machine Learning

EE66120
Elective I
BTech Sixth Semester
Concept
• To program computers so that they can learn from input available to
them.
• Roughly speaking, learning is the process of converting experience
into expertise or knowledge.
• The input to a learning algorithm is training data, representing
experience, and the output is some expertise, which usually takes the
form of another computer program that can perform some task
Examples
• Bait Shyness - Rats Learning to Avoid Poisonous Baits: When rats encounter
food items with novel look or smell, they will first eat very small amounts,
and subsequent feeding will depend on the flavor of the food and its
physiological effects. If the food produces an ill effect, the novel food will
often be associated with the illness, and subsequently, the rats will not eat
it.
• Program a machine that learns how to filter spam e-mails: The machine
can simply memorize all previous e-mails that had been labeled as spam e-
mails by the human user.

While the preceding “learning by memorization” approach is sometimes


useful, it lacks an important aspect of learning systems - the ability to label
unseen e-mail messages.
A successful learner should be able to progress from individual
examples to broader generalization.

This is also referred to as inductive reasoning or inductive inference.

Example: A student should be able to:


1. Deal with the vastness of the subject matter and the related issues in memorizing it
2. Answer questions where a direct answer has not been learnt
• To achieve generalization in the spam filtering task, the learner can
scan the previously seen e-mails, and extract a set of words whose
appearance in an e-mail message is indicative of spam.
• Then, when a new e-mail arrives, the machine can check whether one
of the suspicious words appears in it, and predict its label accordingly.
• Such a system would potentially be able correctly to predict the label
of unseen e-mails.
Introduction
• 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.
• In general, to have a well-defined learning problem, we must identity these three
features: the class of tasks, the measure of performance to be improved, and the
source of experience.
• A checkers learning problem:
• Task T: playing checkers
• Performance measure P: percent of games won against opponents
• Training experience E: playing practice games against itself
• A handwriting recognition learning problem:
• T: recognizing and classifying handwritten words within images
• P: percent of words correctly classified
• E: a database of handwritten words with given classifications
• A robot driving learning problem:
• T: driving on public four-lane highways using vision sensors
• P: average distance traveled before an error (as judged by human overseer)
• E: a sequence of images and steering commands recorded while observing a human driver
Examples
• Learning to recognize spoken words (speech recognition): Neural network learning methods, and
Markov models
• Learning to drive an autonomous vehicle
• Learning to classify new astronomical structures
• Games with computers
• ML have been found to be especially useful in:
• Data mining problems where large databases may contain valuable implicit regularities that can be discovered
automatically for e.g.
• to analyze outcomes of medical treatments from patient databases
• to learn general rules for credit worthiness from financial databases
• Poorly understood domains where humans might not have the knowledge needed to develop effective
algorithms, for e.g.
• Human face recognition from images
• Domains where the program must dynamically adapt to changing conditions, for e.g.
• Controlling manufacturing processes under changing supply stocks
• Adapting to the changing reading interests of individuals
Important Points
• Designing a machine learning approach involves a number of design
choices including:
• Choosing the type of training experience
• The target function to be learned
• Representation for this target function
• An algorithm for learning the target function from training examples.
• Learning involves search: searching through a space of possible hypotheses
to find the hypothesis that best fits the available training examples and
other prior constraints or knowledge.
• Machine learning draws on ideas from a diverse set of disciplines, including
artificial intelligence, probability and statistics, computational complexity,
information theory, psychology and neurobiology, control theory, and
philosophy.
Process of Machine Learning

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
Abstraction
• Abstraction helps in deriving a • The choice of the model used to solve a
specific learning problem is a human task.
conceptual map based on the input
data • The decision related to the choice of
model is taken based on multiple aspects,
• This map, or a model as it is known in some of which are listed below:
• The type of problem to be solved: Whether
the machine learning paradigm, is the problem is related to forecast or
summarized knowledge prediction, analysis of trend, understanding
the different segments or groups of objects,
representation of the raw data. etc.
• Nature of the input data: How exhaustive
• The model may be in any one of the the input data is, whether the data has no
following forms: values for many fields, the data types, etc.
• Domain of the problem: If the problem is in
• Computational blocks like if/else rules a business-critical domain with a high rate of
• Mathematical equations data input and need for immediate
inference, e.g. fraud detection problem in
• Specific data structures like trees or graphs banking domain.
• Logical groupings of similar observations
Generalization
1. It is important for the test data to follow the distribution of
training data.
2. The trained model is aligned with the training data too
much, hence may not portray the actual trend – High
Variance (Overfitting)
3. The test data possess certain characteristics apparently
unknown to the training data.
4. Training Data might be insufficient for the given problem or
the Model is too simple for the given problem- High Bias
(Underfitting)
DESIGNING A LEARNING SYSTEM
• Choosing the Training Experience
• Choosing the Target Function
• Choosing a Representation for the
Target Function
• Choosing a Function Approximation
Algorithm
• Estimating training values
• Adjusting the target function
parameters using optimisation
techniques
• Performance Analysis
Final design of the
checkers learning
program
One useful perspective on
machine learning is that it
involves searching a very large
space of possible hypotheses
to determine one that best fits
the observed data and any
prior knowledge held by the
learner
When Do We Need Machine Learning?
• Two aspects of a given problem may call for the use of programs that
learn and improve on the basis of their “experience": the problem's
complexity and the need for adaptivity
• Tasks That Are Too Complex to Program.
• Tasks Performed by Animals/Humans
• Tasks beyond Human Capabilities
• Adaptivity with the problem
Types of Machine learning methods

1. Supervised learning – Also called predictive learning. A machine predicts the class of unknown
objects based on prior class related information of similar objects.
2. Unsupervised learning – Also called descriptive learning. A machine finds patterns in unknown
objects by grouping similar objects together.
3. Reinforcement learning – A machine learns to act on its own to achieve the given goals.
1. The basic input, or the
experience in the paradigm of
Supervised Learning machine learning, is given in the
form of training data .
2. Training data is the past
information on a specific task.
✓ In context of the image
segregation problem, training
data will have past data on
different aspects or features
on a number of images, along
with a tag on whether the
image is round or triangular,
or blue or green in colour.
3. The tag is called ‘ label’ and it is
said that the training data is
labelled in case of supervised
learning.
Classification
Classification is a type of supervised
learning where a target feature,
which is of type categorical, is
predicted for test data based on the
information imparted by training
data. The target categorical feature is
known as class.

Some typical classification problems


include:
• Image classification
• Prediction of disease
• Win–loss prediction of games
There are number of popular machine learning algorithms • Prediction of natural calamity like
which help in solving classification problems. earthquake, flood, etc.
✓ k-Nearest Neighbor, Logistic regression, Neural Network, • Recognition of handwriting
Naïve Bayes, Decision tree, and other algorithms
Regression
➢ When we are trying to predict a categorical or
nominal variable, the problem is known as a
classification problem.
➢ Whereas when we are trying to predict a real-
valued variable, the problem falls under the
category of regression.

Sepal Length=w1xPetal Length+w0

✓ Demand forecasting in retails


✓ Sales prediction for managers
✓ Price prediction in real estate
✓ Weather forecast
✓ Skill demand forecast in job market
Clustering-Unsupervised Learning
Some important Concepts
• The inductive learning hypothesis: Any hypothesis found to approximate the
target function well over a sufficiently large set of training examples will also
approximate the target function well over other unobserved examples.
• Concept learning: Inferring a boolean-valued function from training examples of
its input and output.
• Given a set of training examples of the target concept c, the problem faced by the learner is
to hypothesize, or estimate, c.
• Symbol H is used to denote the set of all possible hypotheses that the learner may consider
regarding the identity of the target concept
• H is determined by the human designer’s choice of hypothesis representation
• In general, each hypothesis h in H represents a boolean-valued function defined over X; that
is, h : X → {0, 1}.
• The goal of the learner is to find a hypothesis h such that h(x) = c(x) for all x in X
• Inductive learning algorithms can at best guarantee that the output hypothesis
fits the target concept over the training data
Detailed process of machine learning
Preparing to model
• Understand the type of data in the given input data set.
• Explore the data to understand the nature and quality.
• Explore the relationships amongst the data elements, e.g. inter-feature relationship.
• Find potential issues in data.
• Do the necessary remediation, e.g. impute missing data values, etc., if needed.
• Apply pre-processing steps, as necessary.
• Once the data is prepared for modelling, then the learning tasks start off.
• As a part of learning task, following are the steps:
• The input data is first divided into parts – the training data and the test data (called holdout).
This step is applicable for supervised learning only.
• Consider different models or learning algorithms for selection.
• Train the model based on the training data for supervised learning problem and apply to
unknown data.
• Directly apply the chosen unsupervised model on the input data for unsupervised learning
problem.
Data set in ML
• Each row of a data set is called a record or
Instance
• Each data set also has multiple attributes, each
of which gives information on a specific
characteristic.
• Attributes can also be termed as feature,
variable, dimension or field.
• Mathematically, A row or record represents an
m-dimensional point in the m-dimensional field
constituted by each attribute.
• For example, in the data set on students, there
are four attributes namely Roll Number, Name,
Gender, and Age, each of which understandably
is a specific characteristic about the student
entity.
Types of data in machine learning
Types of data in machine learning
• Qualitative data can be further subdivided • Ordinal data, in addition to possessing the
into two types as follows:
properties of nominal data, can also be
Nominal data naturally ordered.
Ordinal data • Ordinal data also assigns named values to
• Nominal data is one which has no numeric attributes but unlike nominal data, they can
value, but a named value. It is used for be arranged in a sequence of increasing
assigning named values to attributes.
• or decreasing value.
• Nominal values cannot be quantified. • Examples of ordinal data are
Examples of nominal data are ✓ Customer satisfaction: ‘Very Happy’, ‘Happy’, ‘Unhappy’, etc.
✓ Blood group: A, B, O, AB, etc. ✓ Grades: A, B, C, etc.
✓ Hardness of Metal: ‘Very Hard’, ‘Hard’, ‘Soft’, etc.
✓ Nationality: Indian, American, British, • Basic counting is possible. Hence, the mode
etc.
can be identified. Mean can still not be
✓ Gender: Male, Female, Other
calculated.
✓ Can be dichotomous
• Since ordering is possible in case of ordinal
• Mathematical operations cannot be data, median, and quartiles can be identified.
performed
• However, counting is supported
• Interval data is numeric data for which not only the order is known, but the exact
difference between values is also known.
• An ideal example of interval data is Celsius temperature. The difference between each value remains
the same in Celsius temperature. For example, the difference between 12°C and 18°C degrees is
measurable and is 6°C
• For interval data, mathematical operations such as addition and subtraction are possible. For that
reason, for interval data, the central tendency can be measured by mean, median, or mode. Standard
deviation can also be calculated.
• Ratio data represents numeric data for which exact value can be measured.
Absolute zero is available for ratio data.
• these variables can be added, subtracted, multiplied, or divided. The central tendency can be measured
by mean, median, or mode and methods of dispersion such as standard deviation.
• Examples of ratio data include height, weight, age, salary, etc.
Exploring numerical data
• Mode • Scatter Plot
• Median • Histogram
• Mean • Box plot
• Variance, Standard
Deviation
• Covariance
• Correlation
Histogram Shapes
Data Normalization
• Mean Normalization
• Mean-variance normalization (z score normalization)
• Min-max normalization

You might also like