0% found this document useful (0 votes)
23 views55 pages

ML 1 (Introduction)

This document discusses machine learning and its applications. It provides definitions of machine learning as learning from experience to improve performance without being explicitly programmed. Popular applications of machine learning discussed include social media features, product recommendations, image recognition, sentiment analysis, and more. Examples of applications that use machine learning like Snapchat, Google Maps, Tinder, Netflix, Replika, Oval Money, Migraine Buddy, and Prisma are described in detail. The document also discusses how humans learn and the types of learning including learning under expert guidance, learning from past knowledge, and self-learning. It defines artificial intelligence, machine learning, and deep learning and provides an overview of the evolution and process of machine learning.

Uploaded by

19se02it47
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)
23 views55 pages

ML 1 (Introduction)

This document discusses machine learning and its applications. It provides definitions of machine learning as learning from experience to improve performance without being explicitly programmed. Popular applications of machine learning discussed include social media features, product recommendations, image recognition, sentiment analysis, and more. Examples of applications that use machine learning like Snapchat, Google Maps, Tinder, Netflix, Replika, Oval Money, Migraine Buddy, and Prisma are described in detail. The document also discusses how humans learn and the types of learning including learning under expert guidance, learning from past knowledge, and self-learning. It defines artificial intelligence, machine learning, and deep learning and provides an overview of the evolution and process of machine learning.

Uploaded by

19se02it47
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/ 55

Machine Learning

Prof. Bhumika Shah


What is machine learning?

● Machine learning is an application of AI that enables systems


to learn and improve from experience without being explicitly
programmed.
● Machine learning focuses on developing computer programs
that can access data and use it to learn for themselves.
Applications of Machine Learning:
● Social Media Features
● Product Recommendations
● Image Recognition
● Sentiment Analysis
● Automating Employee Access Control
● Marine Wildlife Preservation
● Regulating Healthcare Efficiency and Medical Services
● Predict Potential Heart Failure
● Banking Domain
● Language Translation
● Many more…
Popular Applications using ML:
● Snapchat
● This messaging app has excellent face detection abilities.
● Its filters combine ML algorithms with augmented reality. Photos get processed as
data sets with individual color pixels.
● Repeated scanning, contrasting clues, and grayscale values get processed to identify
faces. To emphasize, it also creates 3D masks using data training, scaling, rotation,
alignment, etc.
● Google Maps
● Google studies and analyzes thousands of data sets.
● They use training models to aggregate location data. And later logical regression
gets applied to make parking lot of predictions and related services.
● Tinder
● This dating app uses Smart Photos to find perfect matches and soul
mates.
● Profile swipes get analyzed to reorder popular photos. T
● he system continually learns and improves itself using inputs.

● Netflix ( Amazon Prime and Other OTT platforms)


● This streaming service uses regression and learning algorithms too.
● It classifies content based on genre, actors, reviews, year, etc. T
● he app learns from user action and behavior to recommend the movie
and personalized content.
● Replika
○ Do you wish you had a friend who you could talk to about anything?
○ A friend that would support you and help you whenever you needed help?
○ You can get such a friend in Replika, a friend that is there for you 24/7!
○ Replika is a Machine Learning chatbot that is programmed to be your
friend and help you whenever you need it.
○ This is possible because of advances in Natural Language Processing
that allow a chatbot to sound almost like a human being.
○ Replika is especially helpful for people who are sad, depressed or anxious
and have nobody to talk with them.
○ And even if you have no such problems, you can just use Replika to have fun
talking to someone and finding more about the capabilities of Natural
Language Processing.
● Oval Money
○ Are you someone whose whole salary disappears in a month and you don’t even know
where?
○ Do you want to save money but that never happens?
○ In that case, Oval Money is the app for you! This is a social savings app that allows you
to save your money using machine learning.
○ This app checks your spending habits and researches intelligent saving strategies
that people collectively possess to create an individual money-saving strategy that is
easy to follow.
● Migraine Buddy
○ Do you have frequent migraines that you find difficult to handle?
○ In that case, you can find help in the form of Migraine Buddy.
○ This is an app that helps you record your migraines as they occur and also helps
you track your potential triggers for migraines.
○ Then this app uses machine learning to forecast the possibility of a migraine
occurring based on your previous history and migraine triggers.
○ Migraine Buddy also generates detailed reports about your migraines that allow
doctors to understand whether your prescribed medication is working or not.
○ You can also contact other people in the Migraine Buddy Community via
supportive chat groups and obtain valuable advice.
● Prisma
○ Wouldn’t it be great if you could paint like Leonardo Da Vinci? Well, you
probably can’t but luckily Prisma can do it for you!
○ This is an app that takes your photos and then uses cloud-based neural
networks to change them into works of art.
○ Prisma uses deep learning algorithms to process your images in their own
servers instead of in your local app.
○ This may take some time but it’s totally worth it.
○ The photo you clicked in your living room can be manipulated to look like it
was painted by Vincent Van Gogh. Or maybe Leonardo Da Vinci.
● Facebook
● Twitter
● Instagram
● E-Commerce websites
● Strava and other fitness Applications
● Many more…
Overview of Human Learning
❖ 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 a task as simple as walking down the street or doing the
homework.
➢ Or it can be a complex task of deciding the angle of trajectory of a rocket
for launching in space.
❖ As we keep learning more , efficiency in doing tasks keep improving.
❖ With more knowledge the ability to do homework with less number of
mistakes increases
❖ With more learning, tasks can be performed easily.
Types of Learning…
●Learning under expert guidance
❖ Like a child taught by parents
❖ He calls his hand a ‘hand’ because that is the information he gets from his
parents.
❖ Sky is blue to him because that is what his parents have taught him
❖ Next phase of life is when baby goes to school. He starts with basic
familiarization of alphabets and digits
❖ Moving to words , sentences, paragraphs, etc.
❖ And moves to next phase of life with higher studies, professional life..etc
❖ In all phases of life of a human being there is an element of guided learning So
guided learning is a process of gaining information from a person having sufficient
knowledge due to past experience.
Cont.
●Learning guided by knowledge gained from experts
❖ Knowledge imparted by teacher or mentor at some point of time in some other form or
context.
❖ Ex: a baby can group together all objects of same color even if his parents have not
specifically taught him to do so.
❖ There is no direct learning.
❖ It is some past information shared on some context which is used as a learning to make
decisions.

●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.
❖ Not all things are taught by others.
❖ A lot of things need to be learnt only from mistakes made in the past.
AI-ML-DL :
1. Artificial Intelligence(AI): AI enables machines to think
without any human intervention. It is a broad area of
computer science
2. Machine Learning (ML): ML is a subset of AI that uses
statistical learning algorithms to build smart systems. The
ML systems can automatically learn and improve without
explicitly being programmed.
3. Deep Learning (DL): This subset of AI is a technique that is
inspired by the way a human brain filters information.
Evolution of Machine Learning…
What is Machine Learning?
❖ Before learning this we should be able to answer more
fundamental questions like:
➢ Do machines really learn?
➢ If so , how do they learn?
➢ Which problem do we consider as well posed learning
problem?
➢ What are the important features that are required to well
define a learning problem?

Well Posed:
Having a unique solution whose value changes only slightly if initial conditions change
slightly.
What is Machine Learning…

● Two definitions of Machine Learning are offered.


● Arthur Samuel described it as:
"The field of study that gives computers the ability to
learn without being explicitly programmed." This is an
older, informal definition.
● Tom Mitchell provides a more modern definition:
"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."
Example: playing chess
E = the experience of playing many games of chess
T = the task of playing chess
P = the probability that the program will win the next game

● In general, any machine learning problem can be assigned to one of


two broad classifications:
○ Supervised learning
○ Unsupervised learning
Question….
Suppose your email program watches which emails you do or do
not mark as spam, and based on that learns how to better filter spam.
What is the task T in this setting?
1.Watching you label emails as spam or not spam.
2.The number (or fraction) of emails correctly classified as spam/not
spam.
3.Classify emails as spam or not spam.
4.None of the above, this is not a machine learning algorithm.
{ ANS: Classifying emails as spam or not spam.}
How Machines Learn?
The basic machine learning process can be divided into three parts
1.Data Input:
Past data or past 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
Input
Data
Abstraction
● During the machine learning process, knowledge is fed in the form of
input data. However data cannot be used in the original shape and
form.
● Abstraction helps in deriving a conceptual map based on input data.
● This map or a model as it is known as in machine learning paradigm
is summarized knowledge representation of the raw data.
● The model may be in one of the following forms
○ If/else rules
○ Mathematical equations
○ Data structures like tree or graphs
○ Logical grouping of similar observations
Contd.
● The choice of model to solve a specific learning problem is a human task. The
decision related to the choice of model is taken on multiple aspects like
○ The type of problem to be solved
○ Nature of input data
○ Domain of the problem
● Once the model is chosen the next task is to fit the model based on the input
data.
● For ex:
○ In a case where the model is represented by a mathematical equation , say ‘y=c1 +
c2x’, based on the input data, we have to find out the values of c1 and c2.
○ Otherwise the equation is of no use.
○ So, fitting the model, in this case, means finding the values of unknown coefficients or
constants of the equation or the model.
○ This process of fitting the model based on input data is known as training
○ Also the input data based on which model is being finalized is known as training
data .
Generalization
● Next part is to tune up the abstracted knowledge to a form which can be
used to take future decisions.
● This is achieved as 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.
● But when we want to apply the model to take decision on a set of
unknown data, usually termed as test data, we may encounter two
problems.
○ The trained model is aligned with the training data too much , hence may not
portray the actual trend.
○ The test data possess certain characteristics apparently unknown to the
training data.
Types of Machine Learning
Machine Learning

Supervised learning Unsupervised learning Reinforcement learning

Classification Regression Clustering Association Analysis


Types of Machine Learning
● Supervised learning:
○ Also called predictive learning . A machine predicts the class of
unknown objects based on prior class-related information of
similar objects.
● Unsupervised learning:
○ Also called descriptive learning. A machine finds patterns in
unknown objects by grouping similar objects.
● Reinforcement learning:
○ A machine learns to act on its own to achieve the given goals.
Supervised learning
- Learn from past information
- It is the information about the task the machine has to execute.
- In context of definition of machine learning, this past information is
the experience.
Supervised learning - 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.
● How can a machine know what is round shape or triangular shape?
● How can a machine distinguish image of an object based on whether it is blue or
green in color?
● A machine needs the basic information to be provided to it.
● The basic input is given in the form of training data.
● Training data will have past data on different aspects or features on a number of
images along with the tag on whether the image is round or rectangular or blue or
green in color.
● The tag is called ‘label’ and we say training data is labelled in case of supervised
learning.
Examples of supervised learning
● Predicting the results of a game
● Predicting whether the tumor is malignant or benign
● Predicting the price of domains like real estate , stocks, etc
● Classifying texts such as classifying a set of emails as spam or
not.

● When we are trying to predict a categorical or nominal variable,


the problem is known as classification problem.
● Whereas when we are trying to predict a real values variable, the
problem falls under the category of regression.
Ǫuestion?
You’re running a company, and you want to develop learning algorithms to address each of
two problems.
Problem 1:You have a large inventory of identical items. You want to predict how
many of these items will sell over the next 3 months.

Problem 2: You’d like software to examine individual customer accounts, and for each
account decide if it has been hacked/compromised. Should you treat these as
classification or as regression problems?

1. Treat both as classification problems.


2. Treat problem 1 as a classification problem, problem 2 as a regression problem.
3. Treat problem 1 as a regression problem, problem 2 as a classification problem.
4. Treat both as regression problems.
Answer:

3. Treat problem 1 as a regression problem,


problem 2 as a classification problem.
Classification
● Let’s discuss how to segregate the images of objects based on the shape.
● If image is round, it is put under one category, while if image is of rectangular object, it
is put under another category.
● In which category the machine should put image of unknown category, also called as
test data depends on the information it gets from the past data, which we have called
as training data.
● 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.
● Whole problem revolves around assigning label or category or class to a test data
based on the label or category or class information that is imparted by the training
data.
● Since the target objective is to assign a class label, this type of problem is called
classification problem.
Machine learning algorithms for classification
● Some Machine learning classification
algorithms:
○ Naive Bayes
○ Decision tree
○ k-Nearest Neighbour algorithm

● In summary, classification is a type of supervised learning where a target feature


which is of type categorical is predicted for test data based on information
imparted by training data.
● Some typical classification problems include:
○ Image classification
○ Prediction of disease
○ Win loss prediction of games
○ Prediction of natural calamity
○ 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 variables are continuous in nature.
● In case of linear regression,a straight line relationship is fitted between the
predictor variables and target variables using statistical concept of least
squares method.
● In 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.
Some real life
examples
Example 1:

Given data about the size of houses on the real estate market, try to predict their price. Price
as a function of size is a continuous output, so this is a regression problem.

Example 2:

Given a picture of a person, we have to predict their age on the basis of the given picture
Regression- Contd
● Let us take the example of yearly budgeting exercise of the sales
managers
● They have to give sales prediction for the next year based on sales figure of
previous years investment put in.
● Data related to past and future is continuous in nature.
● A simple linear regression model can be applied with
investment as predictor variable and sales revenue as target variable.
Regression- Contd
● A typical linear regression model can be represented in
the form-
○ y= 𝜶 + 𝜷x
○ Where x is predictor variable and y is target variable
● Given figure here, the input data comes from a famous
multivariate data set names Iris introduced by the British
statistician and biologist Ronald Fisher.
● The data set consists of 50 samples from each of three
species of Iris- Iris setosa, Iris virginica and Iris
versicolor.
● Four features were measured for each sample to
distinguish different species of flower-
○ Sepal length
○ Sepal width
○ Petal length
○ Petal width
Regression- Contd.
● The iris dataset is typically used as a training data for
solving the classification problem of predicting the
flower species based on feature values.
● But we can also demonstrate regression using this data
set by predicting the value of one feature using another
feature as predictor.
● In the figure given previously, petal length is predictor
variable , which helps in predicting the value of target
variable petal width.
● Typical applications of regression
○ Forecasting in retails
○ Sales prediction
○ Price prediction
○ Weather forecasting
○ Skill demand forecasting
Unsupervised learning
● There is no labelled training data to learn from and no prediction to be made.
● The objective is to take a dataset as input and try to
find natural groupings or patterns within the data
● It is often termed as descriptive model and the process of unsupervised
learning is referred to as pattern discovery or knowledge discovery.
● Clustering is the main type of unsupervised learning.
○ It intends to group or organize similar objects together.
○ Objects belonging to the same cluster are quite similar to each other while
objects belonging to different clusters are quite dissimilar.
○ Objective of clustering is to discover the intrinsic grouping of unlabelled data and
form clusters .
○ Different measures of similarity can be applied for clustering
Ǫuestion?
Of the following examples, which would you address using an unsupervised
learning algorithm? (Check all that apply.)

1. Given email labeled as spam/not spam, learn a spam filter.


2. Given a set of news articles found on the web, group them into sets of
articles about the same stories.
3. Given a database of customer data, automatically discover market
segments and group customers into different market segments.
4. Given a dataset of patients diagnosed as either having diabetes or not,
learn to classify new patients as having diabetes or not.
Answer:

● Given a set of news articles found on the web, group them into
set of articles about the same story.
● Given a database of customer data, automatically discover
market segments and group customers into different market
segments.
● Common similarity measure is distance.
● Two data items are considered a part of the same cluster if the distance
between them is less.
● If the distance between the data items is high, the items do not generally
belong to the same cluster.
● This is known as distance based clustering.
Association analysis
● One more variant of unsupervised learning.
● Association between data items is identified.
● Examples: Market basket analysis.
○ From past transaction data in a grocery store, it may be observed that
most of the customers who have bought item A, have also bought item
B and item C or atleast one of them.
○ This means that there is a strong association of the event ‘purchase of
item A’ with the event ‘purchase of item B’ or ‘purchase of item C’ .
○ Identifying these sort of associations is the goal of association analysis.
● Applications:
○ Market basket analysis
○ Recommender systems
Reinforcement learning
● Example: We have seen babies learning to walk without any prior knowledge of how to do it.
○ First they notice how others do it.
○ They understand that legs have to be used, one at a time, to take a step
○ While walking, sometimes they fall down hitting an obstacle, whereas other times they are able to
walk smoothly
○ Babies might get a reward like clapping of hands by parents or chocolates.
○ Obviously no claps when baby falls.
○ Slowly a time comes when the babies learn from mistakes and are able to walk with much ease
● In the same way, machines often learn to do tasks automatically.
● Machine is given a task with hurdles.
● It tries to improve its performance of doing task .
● When a sub task is completed successfully, a reward is given.
● When a sub task is not performed successfully no reward is given
● This continues until the task is completed successfully.
● This process of learning is called reinforcement learning
● Applications
○ Self driving cars
Comparison -
supervised , unsupervised and reinforcement learning
Ǫuestion?
Some of the problems below are best addressed using a supervised learning algorithm, and the
others with an unsupervised learning algorithm. Which of the following would you apply
supervised learning to? (Select all that apply.) In each case, assume some appropriate dataset
is available for your algorithm to learn from.

1. Given a large dataset of medical records from patients suffering from heart disease, try to learn
whether there might be different clusters of such patients for which we might tailor separate
treatments.
2. Have a computer examine an audio clip of a piece of music, and classify whether or not there are
vocals (i.e., a human voice singing) in that audio clip, or if it is a clip of only musical instruments (and
no vocals).
3. Given data on how 1000 medical patients respond to an experimental drug (such as effectiveness of
the treatment, side effects, etc.), discover whether there are different categories or "types" of
patients in terms of how they respond to the drug, and if so what these categories are.
4. Given genetic (DNA) data from a person, predict the odds of him/her developing diabetes over the next
10 years.

You might also like