AI Chapter 3 Part 1
AI Chapter 3 Part 1
Institute of Technology
University of Gondar
Biomedical Engineering Department
Outlines: -
» Machine learning
» Types of learning
o Supervised learning
o Unsupervised learning
✓ K means clustering
o Reinforcement learning
✓ Markov decision process
Machine learning
» It is the field of study that gives computers the ability to learn without being
explicitly programmed (Arthur Samuel, 1959).
» 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 (Tom Mitchell, 1999).
o Task T: classifying handwritten digits from images
Machine
Learning(ML)
A subset of AI technique which uses
statistical methods to enable machine
to improve with experiences
Deep Learning
» Use inference to make predictions about previously unseen data: test data.
Machine learning
Machine learning
Supervised Learning
o Regression
Supervised Learning
Classification
o Predicts categorical class labels (discrete or nominal)
o Classifies data (constructs a model) based on the training set and the values (class
labels) in a classifying attribute and uses it in classifying new data
o Example: classify
✓e-mail as Spam or Non-Spam
✓Bank customers as Fraud or default
✓Patient as Diabetic or Non- diabetic
9
Supervised Learning
Regression/Numeric Prediction
o models continuous-valued functions, i.e., predicts unknown or missing values
» Example:
o predict electric power consumption of a city in Kilo-watt
» Given a set of measurements, observations, etc. with the aim of establishing the
existence of classes or clusters in the data
» Used to draw pattern/form cluster x x x
x x x x x x x
x xx x x x x
✓ Given a set of points, with a notion of distance x x x x x x
x x x xx x
between points, group the points into some number of
clusters, so that members of a cluster are in some x x
sense as close to each other as possible. x x x x
x x x
✓ While data points in the same cluster are similar,
x
those in separate clusters are dissimilar to one another
15
Unsupervised Learning
» The example below demonstrates the clustering of padlocks of same kind. There are
a total of 10 padlocks which various in color, size, shape, etc.
✓ The padlocks of same kind are clustered into a group as shown below
16
Unsupervised Learning
o The company may want to see the distribution of the profile of its customers, to see
what type of customers frequently occur.
o Once such groups are found, the company may decide strategies, for example,
services and products, specific to different groups.
17
Reinforcement learning
18
Reinforcement Learning
» The machine learning program should be able to assess the goodness of policies
and learn from past good action sequences to be able to generate a policy i.e. RL
19
Application of Machine Learning
Learning Associations:
o Basket analysis- In the case of retail-finding associations between products bought by
customers: If people who buy X typically also buy Y
o going over our data, we calculate that P(chips/beer) = 0.7.
✓ we can define the rule: 70 percent of customers who buy beer also buy chips.
Classification:
o Credit scoring -the bank calculates the risk given the amount of credit and the information
about the customer.
✓ Customer Information:-income, savings, collaterals, profession, age, past financial history, and
so forth
✓ record of past loan- the loan was paid back or not
20
Application of Machine Learning
» From this data of particular applications, the aim is to infer a general rule coding
the association between a customer’s attributes and his risk
» The machine learning system fits a model to the past data to be able to calculate
the risk for a new application and then decides to accept or refuse it accordingly.
» After training with the past data, a classification rule learned may be of the form
THEN low-risk
ELSE high-risk
Application of Machine Learning
22
Application of Machine Learning
✓ People have different handwriting styles; characters may be written small or large, slanted,
with a pen or pencil, and there are many possible images corresponding to the same
character.
Face recognition
✓ The input is an image, the classes are people to be recognized, and the learning program
should learn to associate the face images to identities.
✓ Difficulty in lighting, glasses may hide the eyes and eyebrows, and a beard may hide the
chin.
23
Application of Machine Learning
In medical diagnosis
o The inputs are the relevant information we have about the patient and the classes are the
illnesses.
o The inputs contain the patient’s age, gender, past medical history, and current symptoms
In speech recognition-
o the input is acoustic and the classes are words that can be uttered
o This time the association to be learned is from an acoustic signal to a word of some
language
o Different people, because of differences in age, gender, or accent, pronounce the same
word differently, which makes this task rather difficult.
24
Application of Machine Learning
Biometrics is recognition
o Recognition or authentication of people using their physiological and/or behavioral
characteristics
o Examples of physiological characteristics are images of the face, fingerprint, iris, and
palm; examples of behavioral characteristics are dynamics of signature, voice, gait,
and key stroke
Outlier detection
o Which is finding outlier detection the instances that do not obey the rule and are
exceptions
Email Spam:
✓ try to predict whether the email was junk email, or “spam.” . The objective was to design
an automatic spam detector that could filter out spam before clogging the users’ mailboxes
26
Application of Machine Learning
Knowledge Extraction:
o Learning a rule from data also allows knowledge extraction.
o The rule is a simple model that explains the data, and looking at this model we
have an explanation about the process underlying the data.
o For example, once we learn the discriminant separating low-risk and high-risk
customers, we have the knowledge of the properties of low-risk customers.
o We can then use this information to target potential low-risk customers more
efficiently, for example, through advertising.
27
Application of Machine Learning
Regression
» Predict the price of a used car
o Inputs are the car attributes—brand, year, engine capacity, mileage, and other
information—that we believe affect a car’s worth.
o The output is the price of the car. Such problems where the output is a number are
regression problems
» To find the optimal setting, we fit a regression model linking these inputs to coffee
quality and choose new points to sample near the optimum of the current model to
look for a better configuration.
Document clustering
o the aim is to group similar documents
o For example, news reports can be subdivided as those related to politics, sports,
fashion, arts, and so on
30
5 Steps for Approaching a ML
2. Collect data.
31
Steps to apply machine learning on your data:
o Any machine learning task can be broken down into a series of more manageable steps.
✓ Collecting data: Whether the data is written on paper, recorded in text files and spreadsheets,
or stored in an SQL database, you will need to gather it in an electronic format suitable for
analysis.
✓ Exploring and preparing the data: The quality of any machine learning project is based
largely on the quality of data it uses. An often cited statistic suggests that 80 percent of the
effort in machine learning is devoted to data.
✓ Training a model on the data: The specific machine learning task will inform the selection of
an appropriate algorithm, and the algorithm will represent the data in the form of a model.
32
Quiz 2
1. List the types of machine learning and give an example to each of them.