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

ML1-Introduction To Machine Learning

Uploaded by

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

ML1-Introduction To Machine Learning

Uploaded by

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

Introduction to Machine Learning

TS. GVC. Đinh Đồng Lưỡng


Nha Trang University

1
Giới thiệu về AI

 AI: Artificial Intelligence thuật ngữ này


đưa ra năm 1955 bởi John McCarthy
(1927) là nhà khoa học máy tính người
Mỹ, Starford University
 AI được hiệu 2 mức:
 Strong (general) AI
 Weak (specific) AI.

2
Giới thiệu về AI

Strong AI: Robot, chương trình AI có thể làm


robot giống loài mới (human-being, self-
aware).

Robot giúp việc Asimo Robot Sophia

3
Giới thiệu về AI

Weak AI: AI chỉ có thể mô phỏng một số hành


vi của (trí tuệ) con người.

4
Overview: AI, ML, vs Deep Learning

5
What is Machine Learning?

• Thuật toán machine learning là thuật toán


có khả năng học tập từ cơ sở dữ liệu.
• A computer program is said to learn from
experience E with respect to some task T and
performance measure P, if its performance at
tasks in T, as measured by P, improves with
experience E. (Mitchell).

6
What is Machine Learning?

Study of algorithms that


– improve their performance
– at some task
– with experience

7
Traditional vs Machine Learning
Approach

8
Traditional Programming

9
Machine Learning Programming

10
What is Machine Learning?

From Data to Understanding …

Machine Learning in Action

11
Machine Learning in Action

• Decoding thoughts from brain scans

12
Machine Learning in Action

• Stock Market Prediction

13
Machine Learning in Action

• Document Classification

14
Machine Learning in Action

15
Machine Learning in Action

• Cars navigation on their own

The self-driving

16
Machine Learning in Action
Many, many more…
 Machine Learning.
 Data Science, Mining and Knowledge Discovery.
 Computer Vision.
 Natural Language Processing.
 Speech Recognition.
 Evolutionary and Natural Computation.
 Fuzzy Computation and Technologies.
 Artificial Life.
 Knowledge-Based Systems.
 Automated Reasoning.
 Logic and Constraint Programming.
 Intelligent Planning.
 ........ 17
What this course is about

• Covers a wide range of ML techniques


– from basic to state-of-the-art
• You will learn about the methods you heard about
– Naive Bayes, logistic regression, nearest-neighbor,
decision trees, boosting, neural nets, overfitting,
regularization, dimensionality reduction, PCA, SVMs,
kernels, k-means, EM, HMMs, semi-supervised
learning, graphical models, reinforcement learning…
• Covers algorithms, theory and applications

18
Machine Learning Tasks

Broad categories-
• Supervised learning: classification, regression
• Unsupervised learning: Clustering, density estimation
• Semi-supervised learning
• Reinforcement learning
• Many more…

19
Algorithms

Supervised Unsupervised
learning learning

Semi-supervised 20
Machine learning structure

• Supervised learning
Machine learning structure

• Unsupervised learning
Supervised Learning

23
Supervised Learning - Classification

24
Supervised Learning Problems

• Loan application

25
Supervised Learning

• Data: A set of data records (also called


examples, instances or cases) described by
– k attributes: A1, A2, … Ak.
– a class: Each example is labelled with a pre-
defined class.
• Goal: To learn a classification/regression
model from the data that can be used to
predict the classes/values of new (future, or
test) cases/instances.
26
Unsupervised Learning

• Learning without a teacher

27
Unsupervised Learning - Density Estimation

28
Unsupervised Learning - Clustering

• Group similar things e.g. images

29
Unsupervised Learning - Clustering

• The data set has three natural groups of data


points, i.e., 3 natural clusters.

30
Defining the Learning Task
Improve on task, T, with respect to performance metric, P, based on
experience, E.
T: Playing checkers
P: Percentage of games won against an arbitrary opponent
E: Playing practice games against itself

T: Recognizing hand-written words


P: Percentage of words correctly classified
E: Database of human-labeled images of handwritten words

T: Driving on four-lane highways using vision sensors


P: Average distance traveled before a human-judged error
E: A sequence of images and steering commands recorded while
observing a human driver.

T: Categorize email messages as spam or legitimate.


P: Percentage of email messages correctly classified.
E: Database of emails, some with human-given labels
31
Designing a Learning System
• Choose the training experience
• Choose exactly what is to be learned, i.e. the target
function.
• Choose how to represent the target function.
• Choose a learning algorithm to infer the target function
from the experience.

Learner

Environment/
Experience Knowledge

Performance
Element
32
Train, Validation, Test Set in ML

33
Training Set

• The teacher uses knowledge to teach


student solving a problem. In machine
learning, the training set is known from the
teacher to teach the student. Student
(machine learning model) try to remember
and find out insights from training set then
store those insights to its parameters (or
weight) by using optimization algorithms

34
Validation Set

• The main purposes of the set are preventing


the machine from overfitting and
choosing hyperparameters. Preventing
machine from overfitting helps machine
learning model work better with future data
as well as preventing the student from
learning by rote. Choosing hyperparameters
helps to find the best machine learning
algorithm of the rest as well as find the best
student in the class who have a specific gift.
35
Validation Set

• Teacher in class must use some dev set to


find the best student for each type of subject

36
Validation Set: Overfitting Problem

• As the picture
below, dots are
training data and
curves are your
algorithms. The
green curve is
overfitting and the
black is good.

37
Test Set

• This dataset is an independent form train


and development set (Dev set) but three
datasets must have the same distribution.
Imagining, after the student learns from
train set and after teacher chooses the best
student using dev set. The test set as the
exam to check the real ability of student
after learning.

38
Some terminology in machine learning

• Machine Learning is learn from examples


and experience, without being explicitly
programmed. Instead of writing code, you
feed data to the generic algorithm, and it
builds logic based on the data given.
• Machine Learning system consist of
– Data
– Learning
– Modeling
39
Data

• Instance: A single row of data is called an


instance. It is an observation from the domain
• Feature: A single column of data is called a
feature.
• Datasets: A collection of instances is a dataset
• Training Dataset: A dataset that we feed into our
machine learning algorithm to train our model.
• Testing Dataset: A dataset that we use to validate
the accuracy of our model but is not used to train
the model. It may be called the validation dataset.
40
Data

41
Learning
• Machine learning is indeed about automated
learning with algorithms:
• Induction: Machine learning algorithms learn
through a process called induction or inductive
learning.
• Generalization make predictions or decisions
based on specific data instances that were not
seen during training
• Over-Learning is poor performance on data
other than the training dataset. This is also called
42
over-fitting
Learning
• Under-Learning: When a model has not learned
enough structure from the database. This is also
called under-fitting.
• Online Learning is when a method is updated
with data instances from the domain as they
become available
• Offline Learning is when a method is created
on pre-prepared data and is then used
operationally on unobserved data

43
Learning
• Supervised Learning: This is a learning process
for generalizing on problems where a prediction
is required. A “teaching process” compares
predictions by the model to known answers and
makes corrections in the model.
• Unsupervised Learning: This is a learning
process for generalizing the structure in the data
where no prediction is required. Natural
structures are identified and exploited for
relating instances to each other.
44
Modeling
• Model Selection is the process of configuring
and training the model as a model selection
process. Each iteration we have a new model.
• Inductive Bias: Bias is the limits imposed on
the selected model. All models are biased which
introduces error in the model, and by definition
all models have error
• Model Variance: Variance is how sensitive the
model is to the data on which it was trained. A
machine learning method can have a high or a
low variance when creating a model on a dataset
45
Modeling
• Bias-Variance Tradeoff: Model selection can
be thought of as a the trade-off of the bias and
variance. A low bias model will have a high
variance and will need to be trained for a long
time or many times to get a usable model. A
high bias model will have a low variance and
will train quickly, but suffer poor and limited
performance

46

You might also like