Вы находитесь на странице: 1из 34

Machine Learning

COMP3220
Search vs Discovery
Definition- Machine Learning
“A computer program is said to learn from experience E with respect
to some task T and some performance measure P, if its performance
on T, as measured by P, improves with experience E.” -- Tom Mitchell,
Carnegie Mellon University
Machine Learning
Type of artificial intelligence (AI) that provides computers with the ability to
learn without being explicitly programmed.
Machine learning focuses on the development of computer programs that can
teach themselves to grow and change when exposed to new data.
The process of Machine Learning is similar to that of Data Mining. Both systems
search through data to look for patterns.
◦ Data Mining - extract data for human comprehension
◦ Machine learning - uses that data to detect patterns in data and adjust program actions
accordingly.
Machine Learning approach
 Instead of writing a program by hand for each specific task, we collect lots of
examples that specify the correct output for a given input.
 A machine learning algorithm then takes these examples and produces a
program that does the job.
• The program produced by the learning algorithm may look very different from a typical
hand-written program. It may contain millions of numbers.
• If we do it right, the program works for new cases as well as the ones we trained it on.
• If the data changes the program can change too by training on the new data.

 Massive amounts of computation are now cheaper than paying someone to


write a task-specific program.
Typical machine learning problems
Is this cancer?
What is the market value of this house?
Which of these people are good friends with each other?
Will this person like this movie?
Machine Learning - Examples
Database mining
 Large datasets from growth of automation/web -
 e.g. Web click data, medical records, climate, sensor data
Applications can’t program by hand (recognizing pattern)
 e.g. Autonomous vehicles, handwriting recognition, most of Natural Language
Processing (NLP), Computer Vision
Self-customizing programs
 e.g. Amazon, Netflix product recommendations - Which movies will a person
like?
Example contd.
Facebook's News Feed uses machine learning to personalize each
member's feed based on their usage patterns.
◦ If a member frequently stops scrolling in order to read or “like” a particular
friend's posts, the News Feed will start to show more of that friend's activity
earlier in the feed.
It uses Statistical analysis and Predictive analytics to identify patterns
in the user's data and usage patterns to populate the News Feed.
Learning algorithms
Supervised learning
◦ Teach the computer how to do something, then let it use its new found knowledge to do it

Unsupervised learning
◦ Let the computer learn how to do something, and use this to determine structure and
patterns in data

Recommender systems
◦ Estimate a utility function that automatically predicts how a user will like an item

Reinforcement learning
◦ the problem of getting an agent to act in the world so as to maximize its rewards.
Learning algorithms contd.
Supervised learning - Supervised algorithms can apply what has been
learned in the past to new data
Prediction – e.g. regression
Classification – e.g. neural networks
Unsupervised learning - Unsupervised algorithms can draw
inferences from datasets. Given a dataset it is tasked with finding
patterns and correlations therein.
Clustering
Social network Analysis – e.g. identifying close knit group of friends
How supervised learning works…
Each training case consists of an input vector x and a target output
t.
We start by choosing a model-class: – A model-class, f, is a way of
using some numerical parameters, β to map each input vector, x,
into a predicted output y.
Learning usually means adjusting the parameters to reduce the
discrepancy between the target output, t, on each training case
and the actual output, y, produced by the model.


Supervised machine learning framework
y = f(x)
output prediction Image
function feature

Training: given a training set of labeled examples {(x1,y1), …, (xN,yN)},


estimate the prediction function f by minimizing the prediction error on
the training set
Testing: apply f to a never before seen test example x and output the
predicted value y = f(x)

Slide credit: L. Lazebnik


Supervised Learning
Optimize the predictor f(x) using training examples.
 For each training example, we have an input value x_train, for which a corresponding output,
t, is known in advance.
 For each example, we find the difference between the known, correct value t, and our
predicted value f(x_train) (i.e. y).
 With enough training examples, these differences give us a useful way to measure the
“wrongness” of f(x).
 We can then tweak f(x) by tweaking the values of the parameters and to make it “less
wrong”.
 This process is repeated over and over until the system has converged on the best values.

The predictor becomes trained, and is ready to do some real-world predicting.


Supervised learning contd.
Apply a prediction function to a feature representation of the
image to get the desired output:

f( ) = “apple”
f( ) = “tomato”
f( ) = “cow”
Slide credit: L. Lazebnik
Steps
Training Training
Labels
Training
Images
Image Learned
Training
Features model

Testing
Test Image
Image Learned
Prediction
Features model
Slide credit: D. Hoiem and L. Lazebnik
Types of Supervised Learning
Regression: The target output is a real number or a whole vector of
real numbers.
 The price of a stock in 6 months time.
 The temperature at noon tomorrow.
• Classification: The target output is a class label.
 The simplest case is a choice between 1 and 0.
 Will a person default on a loan.
 We can also have multiple alternative labels.
Typical Machine Learning Problems
Regression
A regression model is a model of the relationships between some covariates (predictors) and an outcome.
Regression is a model of the average outcome given the covariates.
Input data x about a certain domain
◦ e.g. square footage of a house
Predict a value f(x)
◦ e.g. market price for said house
f(sq footage)=β0 + β1 𝑆𝑞. 𝐹𝑜𝑜𝑡𝑎𝑔𝑒 + ε
Other input variables - no of bedrooms, no of bathroom, no of floors, year built , Zip code)

Predictors have this form, Y=β0 + β𝑖𝑥𝑖 + ε


ε – Error
β0 and β1 - Constants
Example - Salary and Satisfaction

https://www.toptal.com/machine-learning/machine-learning-theory-an-introductory-primer
Predictors on training set
f f

https://www.toptal.com/machine-learning/machine-learning-theory-an-introductory-primer
Predictors on training set
f

https://www.toptal.com/machine-learning/machine-learning-theory-an-introductory-primer
Typical Machine Learning Problems
Classification
Examples
• Artificial Neural Networks
• Decision Trees
Artificial Neural Network
Output is a ‘squashed’ linear function of the inputs
Neural Network - ML
Neural Network as classifier
Binary classification
◦ Single output (0 or 1)
◦ So single output node - value is going to be a real number
◦ k=1
◦ NB k is number of units in output layer

Multi-class classification
◦ k distinct classifications
◦ Typically k is greater than or equal to three
◦ Y is k-dimentional vector of real numbers
Feed forward Neural Network
A parametrized value of non linear functions
Neural Networks
 What is the learning process in ANN?
 Updating network architecture and connection weights so that network can efficiently perform a task

 What is the source of learning for ANN>


 Available training patterns
 The ability of ANN to automatically learn from examples or input-output relations.

 How to design a Learning Process?


 Knowing about available information.
 Having a model from environment (Learning Paradigm).
 Figuring out the update process of weights. (Learning Rules).
 Identifying a procedure to adjust weights by learning rules (Learning Algorithms)
Unsupervised Learning
Unsupervised learning used to draw inferences from datasets consisting of input data
without labelled responses.
Since the examples given to the learner are unlabelled, there is no error or reward signal
to evaluate a potential solution – this distinguishes unsupervised learning from
supervised learning and reinforcement learning.
The most common unsupervised learning method is cluster analysis, which is used for
exploratory data analysis to find hidden patterns or grouping in data.
Aims of unsupervised learning:
 To create an internal representation of the input that is useful for subsequent supervised or
reinforcement learning.
 It provides a compact, low-dimensional representation of the input.
 It finds sensible clusters in the input.
Typical Machine Learning Problems
Dimensionality Reduction: PCA
50D -> 2D
Typical Machine Learning Problems
Clustering – KMeans
Task of grouping a set of objects in such a way that objects in the same group (called a cluster)
are more similar (in some sense or another) to each other than to those in other groups
(clusters).
◦ High intra cluster similarity
◦ Low inter cluster similarity
Summary
Modern machine learning problems take thousands or even millions of dimensions of data to build predictions using
hundreds of coefficients.
Examples of complex problems
 Predicting how an organism’s genome will be expressed
 What the climate will be like in fifty years
Supervised learning - labeled data
◦ Linear regression
◦ Logistic regression
◦ Neural networks
◦ Support vector machines

Unsupervised learning - unlabeled data


◦ K-means
◦ PCA
◦ Anomaly detection

Вам также может понравиться