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

Module 1

The document outlines a course on Machine Learning, detailing prerequisites, learning objectives, and key concepts such as supervised, unsupervised, and reinforcement learning. It explains the machine learning process, including data input, abstraction, generalization, and the importance of model selection and training data. Additionally, it discusses applications, issues, and the limitations of machine learning in various contexts.

Uploaded by

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

Module 1

The document outlines a course on Machine Learning, detailing prerequisites, learning objectives, and key concepts such as supervised, unsupervised, and reinforcement learning. It explains the machine learning process, including data input, abstraction, generalization, and the importance of model selection and training data. Additionally, it discusses applications, issues, and the limitations of machine learning in various contexts.

Uploaded by

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

Machine Learning

BCSML601
3:0:2
Pre- requisites
• Linear Equations
• Probability and Statistics
• Graphs of Functions
Course Learning Objectives (CLO)
• This course will enable students to,
• Define machine learning and understand the basic theory underlying
machine learning.
• Differentiate supervised, unsupervised and reinforcement learning
• Understand the basic concepts of learning and decision trees.
• Understand neural networks and Bayesian techniques for problems appear
in machine learning
• Understand the instant based learning and statistical analysis of machine
learning techniques.
MODULE 1
• Introduction to Machine Learning
• Introduction
• What is Human Learning?
• Types of Human Learning,
• What is Machine Learning,
• Types of Machine Learning,
• Problems not to be solved using Machine Learning,
• Application of Machine Learning,
• Issues in Machine Learning,
• Prepare to Model –
• Introduction,
• Machine Learning activities,
• Basic types of Data in Machine Learning
Evolution
Human Learning
• Data
• Information
• Knowledge
• Wisdom

• In cognitive science, learning is referred to as the process of gaining


information through observation.
• With more learning, gather information, and tasks can be performed more
efficiently.
TYPES OF HUMAN LEARNING
• Thinking intuitively, human learning happens in one of the three ways –
1. Expert Guidance Learning - somebody who is an expert in the subject
directly teaches us
• Learning at different stages of life - Infant, School, College, University, Work place
2. Knowledge Gained Learning - we build our own notion indirectly based on
what we have learnt from the expert in the past
• It is some past information shared on some different context, which is used as a
learning to make decisions.
3. Self learning - we do it ourselves, may be after multiple attempts, some
being unsuccessful.
• Baby starts walking, learning by mistakes, things to do and not to do
Machine Learning
• Professor 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.’
• It means that a machine can 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.
• Past experience here, means past data related to the task, which is the input to
the machine from some source.
• Example: In image classification, E represents the past data with images having labels
or assigned classes like image is of a class cat or a class dog or a class elephant etc., T
is the task of assigning class to new, unlabeled images and P is the performance
measure indicated by the percentage of images correctly classified.
How Machines Learn?
• 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
• How does a student learn from book and prepare for Examination?
• Memorize or Learn By Heart!!! – possible if the content is limited
• If scope becomes broader and examination questions are complex???
• A better learning strategy needs to be adopted:
1. to be able to deal with the vastness of the subject matter and the related issues
in memorizing it
2. to be able to answer questions where a direct answer has not been learnt
• A Solution is to figure out the key points or ideas amongst a vast pool of
knowledge which helps in creating an outline of topics and a conceptual
mapping of those outlined topics with the entire knowledge pool.
• Example: A Transportation system – different modes and different vehicles for
those modes
• Data Input – Transportation systems
• Abstraction – categorization as landways, airways, waterway and the
characteristics of its respective associated vehicles
• Generalization – Mapping between transportation system and an unlabeled
vehicle or vice versa
Abstraction
• During the machine learning process, knowledge is fed in the form of input
data, but the 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
• The choice of the model used to solve a specific learning problem is a
human task.
• The decision related to the choice of model is taken based on multiple
aspects, some of which are listed below:
• The type of problem to be solved: Whether the problem is related to forecast
or prediction, analysis of trend, understanding the different segments or groups
of objects, etc.
• Nature of the input data: How exhaustive the input data is, whether the data
has no values for many fields, the data types, etc.
• Domain of the problem: If the problem is in a business critical domain with a
high rate of data input and need for immediate inference, e.g. fraud detection
problem in banking domain.
• Once the model is chosen, the next task is to fit the model based on the input
data.
• Example: In a case where the model is represented by a mathematical equation,
say ‘y = c1 + c2 x’ (the model is known as simple linear regression), based on
the input data, we have to find out the values of c1 and c2.
• 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.
• Also, the input data based on which the model is being finalized is known as
training data.
Generalization
• Generalization is to tune up the abstracted knowledge to a form which can be
used to take future decisions.
• This part is quite difficult to achieve, since the model is trained based on a finite
set of data, which may possess a limited set of characteristics.
• But when the model is to be applied to take decision on a set of unknown data,
usually termed as test data, two problems may occur:
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.
• Hence, rather than a precise approach of decision-making, an approximate or
heuristic approach, much like gut feeling-based decision-making in human
beings, has to be adopted.
• This approach has the risk of not making a correct decision – quite obviously
because certain assumptions that are made may not be true in reality.
TYPES OF MACHINE LEARNING
• Machine learning can be classified into three broad categories:
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.
Supervised learning
• Supervised learning is a technique to learn from past information or experience.
• It is the information about the task which the machine has to execute.
• Example: Say a machine is getting images of different objects as input and the task is to
segregate the images by either shape or colour of the object.
• If it is by shape, the images which are of round-shaped objects need to be separated from
images of triangular-shaped objects, etc.
• If the segregation needs to happen based on colour, images of blue objects need to be
separated from images of green objects.
• A machine is to be guided with the basic information on shape and colour before it can start
doing the task.
• Supervised machine learning is as good as the data used to train it.
• If the training data is of poor quality, the prediction will also be far from being precise
• A machine needs the basic information to be provided to it.
• This basic input, or the experience is given in the form of training data.
• 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.
• The tag is called ‘ label’ and the training data is labelled in case of supervised learning.
• Some examples of supervised learning are
1. Predicting the results of a game
2. Predicting whether a tumor is malignant or benign
3. Predicting the price of domains like real estate, stocks, etc.
4. Classifying texts such as classifying a set of emails as spam or non-spam
• Considering example 2 and 3, are they both the same?
• Though both of them are prediction problems, one case deals with prediction on
which category or class an unknown data belongs to whereas in the other case
the prediction is an absolute value and not a class.
• When the prediction of test data is on a categorical or nominal variable, the
problem is known as a classification problem and The target categorical feature
is known as class.
• Whereas when the prediction is a real-valued variable, the problem falls under
the category of regression.
Classification
• Since the training data has a label
or category defined for each and
every image, the machine has to
map a new image or test data to a
set of images to which it is similar
to and assign the same label or
category to the test data.
• The whole problem revolves
around assigning a label or
category or class to a test data
based on the label or category or
class information that is imparted There are number of popular machine learning
by the training data. classification algorithms like, Naïve Bayes,
• Since the target objective is to Decision tree, and k-Nearest Neighbour
assign a class label, this type of
problem as classification problem.
algorithms
• Some typical classification problems include:
• Image classification
• Prediction of disease
• Win–loss prediction of games
• Prediction of natural calamity like earthquake, flood, etc.
• Recognition of handwriting
Regression
• In linear regression, the objective is to predict numerical features like real estate or stock
price, temperature, marks in an examination, sales revenue, etc.
• The underlying predictor variable and the target variable are continuous in nature.
• In case of linear regression, a straight line relationship is ‘fitted’ between the predictor
variables and the target variables, using the statistical concept of least squares method.
• As in the case of least squares method, the sum of square of error between actual and
predicted values of the target variable is tried to be minimized.
• In case of simple linear regression, there is only one predictor variable whereas in case of
multiple linear regression, multiple predictor variables can be included in the model.
• A typical linear regression model can be represented in the form –

• where ‘x’ is the predictor variable and ‘y’ is the target variable.
• Typical applications of regression can be seen in
• Demand forecasting in retails
• Sales prediction for managers
• Price prediction in real estate
• Weather forecast
• Skill demand forecast in job market
Unsupervised learning
• In unsupervised learning, there is no labelled training data to learn from and no
prediction to be made.
• In unsupervised learning, the objective is to take a dataset as input and try to
find natural groupings or patterns within the data elements or records.
• Therefore, unsupervised learning is often termed as descriptive model
• The process of unsupervised learning is referred as pattern discovery or
knowledge discovery.
• One critical application of unsupervised learning is customer segmentation.
• Clustering is the main type of unsupervised learning, which intends to group or
organize similar objects together.
• Association analysis is another unsupervised learning, where the association
between data elements is identified.
• Objects belonging to the same cluster are similar to each other while objects
belonging to different clusters are dissimilar.
• Hence, the objective of clustering to discover the intrinsic grouping of
unlabelled data and form clusters, as depicted in Figure 1.
• Different measures of similarity can be applied for clustering, of which most
common is distance.
• Two data items are considered as a part of the same cluster if the distance
between them is less.
• In the same way, if the distance between the data items is high, the items do not
generally belong to the same cluster.
• This is also known as distance-based clustering.
• Figure 2 depicts the process of clustering at a high level.
Figure 2

Figure 1
Reinforcement learning
• We have seen babies learn to walk without any prior knowledge of how to do it.
• Machines often learn to do tasks autonomously.
• Let’s try to understand in context of the example of the child learning to walk.
• The action tried to be achieved is walking, the child is the agent and the place
with hurdles on which the child is trying to walk is the environment.
• It tries to improve its performance of doing the task.
• When a sub-task is accomplished successfully, a reward is given. When a sub-
task is not executed correctly, obviously no reward is given.
• This continues till the machine is able to complete execution of the whole task.
• This process of learning is known as reinforcement learning.
• Figure captures the high-level process of reinforcement learning.
• Key Concepts of
Reinforcement
Learning

• Agent: The learner or


decision-maker.

• Environment: Everyt
hing the agent
interacts with.

• State: A specific
situation in which the
agent finds itself.

• Action: All possible


moves the agent can
make.
PROBLEMS NOT TO BE SOLVED USING MACHINE LEARNING

• Machine learning should not be applied to tasks in which humans are very effective or
frequent human intervention is needed.
• Air traffic control is a very complex task needing intense human involvement.
• Simple rule-driven or formula-based applications like price calculator engine, dispute
tracking application, etc. do not need machine learning techniques.
• Machine learning should be used only when the business process has some lapses.
• If the task is already optimized, incorporating machine learning will not serve to justify the
return on investment.
• For situations where training data is not sufficient, machine learning cannot be used
effectively.
• This is because, with small training data sets, the impact of bad data is exponentially worse.
• For the quality of prediction or recommendation to be good, the training data should be
sizeable.
Applications
• Banking and Finance – fraudulent transactions are spotted and prevented right
at the time of occurrence
• Insurance - Two major areas in the insurance industry where machine learning
is used are risk prediction during new customer onboarding and claims
management.
• Health Care - Wearable device data form a rich source for applying machine
learning and predict the health conditions of the person real time.
Issues of Machine Learning
• The biggest fear and issue arising out of machine learning is related to privacy and the breach
of it a well as adverse reactions.
• The primary focus of learning is on analyzing data, both past and current, and coming up
with insight from the data which may be related to people and the facts revealed might be
private enough to be kept confidential.
• Also, different people have a different preference when it comes to sharing of information.
• While some people may be open to sharing some level of information publicly, some other
people may not want to share it even to all friends and keep it restricted just to family
members.
• When machine learning algorithms are implemented using those information, inadvertently
people may get upset.
• A very critical consideration before applying machine learning is that proper human
judgement should be exercised before using any outcome from machine learning.
• Only then the decision taken will be beneficial and also not result in any adverse impact.
Machine Learning Activities
• The first step in machine learning activity starts with data.
• In case of supervised learning, it is the labelled training data set followed by test data which
is not labelled.
• In case of unsupervised learning, there is no question of labelled data but the task is to find
patterns in the input data.
• A thorough review and exploration of the data is needed to understand the type of the data,
the quality of the data and relationship between the different data elements.
• Based on that, multiple pre-processing activities may need to be done on the input data
before going ahead with core machine learning activities.
• Following are the typical preparation activities done once the input data comes
into the machine learning system:
• 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 and as a part of
it, do the following activities:
• The input data is first divided into parts – the training data and the test data (called
holdout) ( 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.
• After the model is selected, trained (for supervised learning), and applied on
input data, the performance of the model is evaluated.
• Based on options available, specific actions can be taken to improve the
performance of the model, if possible.
• Figure depicts the four-step process of machine learning.
BASIC TYPES OF DATA IN MACHINE LEARNING
• A data set is a collection of related information or records.
• The information may be on some entity or some subject area.
• Each row of a data set is called a record.
• Each data set also has multiple attributes, each of which gives information on a specific
characteristic.
• For example, in the data set on students, there are four attributes namely Roll Number, Name,
Gender, and Age, each of which is a specific characteristic about the student entity.
• Attributes can also be termed as feature, variable, dimension or field.
• Both the data sets, Student and Student Performance, are having four features or dimensions;
hence they are told to have four dimensional data space.
• A row or record represents a point in the four-dimensional data space as each row has specific
values for each of the four attributes or features.
• Value of an attribute, may vary from record to record.
Data types
• Different types of data broadly divided into following two types:
1. Qualitative data
2. Quantitative data
Qualitative Data
• Qualitative data provides information about the quality of an object or information which
cannot be measured.
• For example, the quality of performance of students in terms of ‘Good’, ‘Average’, and
‘Poor’. Also, name or roll number of
• students cannot be measured using some scale of measurement.
• Qualitative data is also called categorical data.
• Qualitative data can be further subdivided into two types as follows:
1. Nominal data
2. Ordinal data
Nominal Data
• Nominal data is one which has no numeric value, but a named value.
• It is used for assigning named values to attributes.
• Nominal values cannot be quantified.
• Examples of nominal data are
• Blood group: A, B, O, AB, etc.
• Nationality: Indian, American, British, etc.
• Gender: Male, Female, Other
• A special case of nominal data is when only two labels are possible, e.g.
pass/fail as a result of an examination.
• This sub-type of nominal data is called ‘dichotomous’.
• Mathematical operations and statistical functions cannot be performed on
nominal data, but only basic count, is possible.
Ordinal Data
• Ordinal data, having the properties of nominal data, can be naturally ordered.
• Ordinal data assigns named values to attributes but, they can be arranged in a
sequence of increasing or decreasing value, so that a value can be compared to be
better than or greater than another value.
• Examples of ordinal data are
• Customer satisfaction: ‘Very Happy’, ‘Happy’, ‘Unhappy’, etc.
• Grades: A, B, C, etc.
• Hardness of Metal: ‘Very Hard’, ‘Hard’, ‘Soft’, etc.
• Basic counting is possible for ordinal data, hence, the mode can be identified.
• Since ordering is possible in ordinal data, median, and quartiles can be identified
in addition.
• Mean can still not be calculated.
Quantitative Data
• Quantitative data relates to information about the quantity of an object – hence
it can be measured.
• For example, consider the attribute ‘marks’, it can be measured using a scale of
measurement.
• Quantitative data is also termed as numeric data.
• There are two types of quantitative data:
1. Interval data
2. Ratio data
Interval Data
• Interval data is numeric data for which the order is known, and also the exact
difference between values is also known.
• An ideal example of interval data is Celsius temperature where 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 as in the case of difference between 15.5°C and 21.5°C.
• Other examples include date, time, etc.
• For interval data, mathematical operations are possible.
• Hence, for interval data, the central tendency can be measured by mean, median,
mode, Standard deviation can be calculated.
• However, interval data do not have something called a ‘true zero’ value.
• For example, there is nothing called ‘zero or null temperature’ or ‘no
temperature’.
• Hence, only addition and subtraction applies for interval data.
• The ratio cannot be applied. This means, we can say a temperature of 40°C is
equal to the temperature of 20°C + temperature of 20°C.
• However, we cannot say the temperature of 40°C means it is twice as hot as in
temperature of 20°C.
Ratio Data
• Ratio data represents numeric data for which exact value can be measured.
• Absolute zero is available for ratio data.
• Also, 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.
Summary of Types of Data
• The attributes can be either discrete or continuous based on based on a number of
values that can be assigned.
• Discrete attributes can assume a finite or countably infinite number of values.
• Nominal attributes such as roll number, street number, pin code, etc. can have a
finite number of values whereas numeric attributes such as count, rank of
students, etc. can have countably infinite values.
• A special type of discrete attribute which can assume two values only is
called binary attribute.
• Examples of binary attribute include male/ female, positive/negative, yes/no, etc.
• Continuous attributes can assume any possible value which is a real number.
• Examples of continuous attribute include length, height, weight, price, etc.
• In general, nominal and ordinal attributes are discrete, and, interval and ratio
attributes are continuous
Module 1 learning
• Introduction to Machine Learning
• What is Human Learning?
• Types of Human Learning,
• What is Machine Learning,
• Types of Machine Learning,
• Problems not to be solved using Machine Learning,
• Application of Machine Learning,
• Issues in Machine Learning,
• Prepare to Model –
• Machine Learning activities,
• Basic types of Data in Machine Learning

You might also like