ENG6500 1 IntroductionToMLDL Part1
ENG6500 1 IntroductionToMLDL Part1
Generalization:
o Deduce new facts from old facts
o Essentially a predictive activity
o Assumes that the past predicts the future.
o Limited by:
• Accuracy of deduction process
Learning and memory are closely related concepts. Learning is the acquisition of
skill or knowledge, while memory is the expression of what you've acquired.
7
AI: Machine/Deep Learning
Human Intelligence
• Solve Problems
• Achieve Goals
• Analyze & Reason
• Communicate, collaborate & Influence
• Consciousness (emotion, intuition, imagination, creativity)
• Using their intelligence, humans are able to learn, form
concepts, understand, and apply logic and reason.
9
Artificial Intelligence
• Artificial Intelligence means
getting a computer to mimic
human behavior in some way
(Speech recognition, Image
Classification, …) .. Rule
Based.. Expert Systems
• Machine learning is a subset
of AI and pretty old field.
It incorporates algorithms
that have been around and
new algorithms … Data
Driven
• Deep Learning is a very
young field of AI that is
powered by multi layered
ANNs .. Also Data Driven
but more robust 10
Artificial Intelligence: History
o The field of AI was not formally founded until 1956, at a conference at Dartmouth
College, in Hanover, New Hampshire, where the term “artificial intelligence” was
coined. A group of computer scientists proposed that computers could be
programmed to think and reason
o Machine learning started in the late 60’s early 70’s and began to flourish in the 80’s.
o Deep Learning, is a subset of machine learning that came to life in 2010-2012 that
enables computers to solve more complex problems .. NLP, Vision, Automation …
11
Artificial Intelligence: History
12
Generative AI
o Deep Learning (DL) can be classified to (a) Discriminative, (b) Generative
o Discriminative DL is used to classify or predict (no new data generated)
o Generative AI is a subset of Deep Learning that generates new data
13
Tom Mitchell: ML Definition
• Tom Mitchell (1988) well posed Learning Problem:
• 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.
15
Related Fields
data
mining control theory
statistics
decision theory
information theory Machine
Learning
cognitive science
databases
psychological models
evolutionary neuroscience
models
Email Anti-Spam
It is Everywhere
Character Recognition
Voice Recognition
Now
2016
How?
past future
Unseen
27
Machine Learning
Machine learning is a field of computer science that gives computers
the ability to learn without being explicitly programmed
Training Data
Learning via Optimization
? Machine Learning
Labeled Data algorithm
Training Phase
Prediction
Accuracy
Learned
Labeled Data Prediction
model
Unseen Data
Hyper Parameter Tuning
Continuous Label
Discrete Label
class B
Clustering
class A
Regression
Classification
Predict house price
Anomaly Detection
Sequence labeling
…
Reinforcement Learning 30
ML: Applications
31
Data
Data Objects
Data sets are made up of data objects.
A data object represents an entity.
Rows represent:
o Medical records: patients, treatments
o University records: students, professors, courses
Also called samples , examples, instances, data points,
objects, tuples.
Data objects are described by attributes (features).
Data: Features
Object #1
o Rows -> data objects;
Object #2
o Columns -> attributes. Object …
Object #n
33
Attributes (Features)
Whenever you perform classification, the first
step is to understand the problem and identify
potential features and label.
Features are those “characteristics” which affect
the results obtained by the ML model.
Features also known as “Attributes” which help the
model during classification, regression & clustering.
For example, in the case of a loan distribution, bank
manager's identify customer’s occupation, income,
age, location, previous loan history, transaction
history, and credit score.
34
Records Features
& FeaturesLabel
Weather data example: Play or not to Play?
Predictions
l Overcast Mild High True Yes
m Overcast Hot Normal False Yes
n Rainy Mild High True No
35
Example
Training data: Points with d features X, and a label Y
Goal: Find a rule to predict label Y from features X for new data
One solution would be to use rules (If-then-else) statements to solve
the problem.
Rules may become very complex to solve the problem!!
Features Label 36
Data Preprocessing
Why Data Preprocessing?
• Data in the real world is dirty
– incomplete: lacking attribute values, lacking certain
attributes of interest, or containing only aggregate data
– noisy: containing errors or outliers
– inconsistent: containing discrepancies in codes or names
• No quality data, no quality mining results!
– Quality decisions must be based on quality data
– Data warehouse needs consistent integration of quality data
39
Why/When Machine Learning?
Machine Learning vs. Traditional Programming
Answer: Prediction
Label
41
Where ML works best?
• Complex problems involving a large amount of data with
lots of variables, but no existing formula or equation
that describes the system.
• Some common scenarios where machine learning applies
1. Systems are too complex for handwritten rules
a) Face and speech recognition
b) FPGA routability prediction.
c) ASIC congestion estimation.
2. Rules of a task are constantly changing
a) Fraud detection
b) Email Spam
3. Nature of the data itself keeps changing
a) Automated trading, predicting shopping trends,
b) Mutations in viruses
42
Why are things working today?
• More data
Accuracy
• Better algorithms
/models
43
Machine Learning Methods
Machine Learning Approaches
Machine
Learning
Semi- Reinforcement
Supervised Unsupervised
supervised Learning
. .
Machine learning provides systems with the ability to learn
without being explicitly programmed.
45
Machine Learning Approaches
Depending on the existence of labels and type of labels we can have
the following types
46
Regression
Regression y
Y1
Regression analysis: A collective name
for techniques for the modeling and
Y1’
analysis of numerical data consisting of y=x+1
values of a dependent variable (also
called response variable or
X1 x
measurement) and of one or more
independent variables (aka. explanatory
variables or predictors) Used for prediction
(including forecasting
The parameters are estimated so as to
of time-series data),
give a "best fit" of the data inference, hypothesis
Most commonly the best fit is evaluated testing, and modeling of
by using the least squares method, but causal relationships
other criteria have also been used
48
A Regression Example
The best fit line is determined by varying the values of m (Slope) and w0.
Other Applications?
The values of m and w0 get selected in such a way to produce the minimum predictor error.
49
Determining the slope, intercept of the line is an Optimization Problem (GD)
49
Stock Market
50
Weather Prediction
Temperature
51
Classification
Supervised Learning: Classification
• The classification has two phases, a training (learning) phase, and
the testing (evaluation) phase.
• In the training phase, classifier trains its model on a given
dataset.
• The model is developed during the training phase.
o Development of the model means that several parameters are
adjusted to predict a value (weights in ANN).
• In the evaluation phase, it tests the classifier performance.
• Performance is evaluated on the basis of various parameters
such as accuracy, error, precision, and recall.
Training
Testing 55
Supervised Learning: Examples
– Disease diagnosis
• x: Properties of patient (symptoms, lab tests)
• f : Disease, Diagnosis (or maybe: recommended therapy)
– Part-of-Speech tagging
• x: An English sentence (e.g., The can will rust)
• f : The part of speech of a word in the sentence
– Face recognition
• x: Bitmap picture of person’s face
• f : Name the person (or maybe: a property of)
– Automatic Steering
• x: Bitmap picture of road surface in front of car
• f : Degrees to turn the steering wheel
56
Classification Example 1
Day Outlook Temperature Humidity Wind Play Tennis
1 Sunny Hot High Weak No
2 Sunny Hot High Strong No
3 Overcast Hot High Weak Yes
4 Rain Mild High Weak Yes
5 Rain Cool Normal Weak Yes
6 Rain Cool Normal Strong No
7 Overcast Cool Normal Strong Yes
8 Sunny Mild High Weak No
9 Sunny Cool Normal Weak Yes
10 Rain Mild Normal Weak Yes
11 Sunny Mild Normal Strong Yes
12 Overcast Mild High Strong Yes
13 Overcast Hot Normal Weak Yes
14 Rain Mild High Strong No
Outlook
Label
Sunny Overcast Rain
Decision Tree Algorithm
Humidity Yes Wind
From this data we can build an ML algorithm in the form of Decision Tree for classification57
Classification Example 2
Machine Learning Algorithm
Should be able to create this
Partition or border to distinguish
You can differentiate Between low risk and high risk
58
Classification Example 3
In this case we use an Artificial Neural Network
Classify a fruit to be one of 3 classes
We may select 4 features for classification
59
Unsupervised Learning
Unsupervised Learning
• Draws inferences from datasets that don’t have
labeled responses associated with the input data.
62
Unsupervised learning
Create Clusters (groups) of similar features
64
Article Clustering
Apply ML to classify documents (Clustering)
environment
Learn a Policy
Reward (r) Action (a) Pi(s,a)
new state (s)
agent
Applications:
• Robotics
Towel Folding • Playing chess
http://youtu.be/gy5g33S0Gzo
69
Summary
Summary
o Over the past decade, artificial intelligence (AI) has become a
popular subject both within and outside of the scientific
community.
o AI is a field focused on automating intellectual tasks normally
performed by humans, and ML and DL are specific methods of
achieving this goal.
o Machine Learning is a diverse field covering a wide territory
(stats, neuro science, …) and has impacted many verticals.
o It is able to tackle tasks in language and image processing,
anomaly detection, credit scoring sentiment analysis, forecasting
alongside dozens of other downstream tasks.
o Machine learning tasks are typically classified into three broad
categories, depending on the nature of the learning "signal" or
"feedback" available to a learning system. These are: (a)
Supervised, (b) Unsupervised, (c) Reinforcement Learning
72
Resources
ML Intro: Misc. Resources
o YouTube (Introduction to Machine Learning)
• https://www.youtube.com/watch?v=KNAWp2S3w94
• https://www.youtube.com/watch?v=ukzFI9rgwfU
• https://www.youtube.com/watch?v=XvZsiWj6VuU
• https://www.youtube.com/watch?v=h0e2HAPTGF4
• https://www.youtube.com/watch?v=Gv9_4yMHFhI
• https://www.youtube.com/watch?v=IpGxLWOIZy4
• https://www.youtube.com/watch?v=f_uwKZIAeM0
• https://data-flair.training/blogs/machine-learning-tutorial/
• https://www.youtube.com/watch?v=Vx2DpMgplEM
• https://www.youtube.com/watch?v=wvODQqb3D_8
74
ML Intro: Misc. Resources
o Courses and mini courses on Machine Learning:
• Excellent Course on Python & ML
• https://www.youtube.com/playlist?list=PLeo1K3hjS3us_ELKYSj_Fth2tIEkdKXvV
• Misc Courses:
• https://www.youtube.com/watch?v=NWONeJKn6kc&t=533s
• https://www.youtube.com/playlist?list=PLwdnzlV3ogoVDlDwuB9SLJzhaZT0tTil3
• https://www.learndatasci.com/best-machine-learning-courses/
• https://www.coursera.org/learn/machine-learning
• https://www.edx.org/learn/machine-learning
• https://developers.google.com/machine-learning/crash-course/
• https://www.udemy.com/topic/machine-learning/
• https://www.youtube.com/watch?v=9f-GarcDY58
• https://www.youtube.com/watch?v=79ry4-FdrdM
• https://www.tensorflow.org/resources/learn-ml?gclid=CjwKCAjw6dmSBhBkEiwA_W-
EoOrWHh10oPeIdMF2LXISTAMxeZ7dWIqcdbp-Uka9Jw2FdoSS7Xh8TxoCnUsQAvD_BwE
• Microsoft Mini Course on ML:
• https://www.youtube.com/playlist?list=PLlrxD0HtieHjNnGcZ1TWzPjKYWgfXSiWG
• https://github.com/features/codespaces
• Python For Beginners
• https://www.youtube.com/playlist?list=PLlrxD0HtieHhS8VzuMCfQD4uJ9yne1mE6
75
ML Intro: Misc. Resources
o Documents:
• https://www.simplilearn.com/data-mining-vs-machine-learning-
article#:~:text=Data%20mining%20is%20designed%20to,total%20of%20the%20gathered%20data.
• https://www.seas.upenn.edu/~cis519/fall2017/lectures/01_introduction.pdf
• https://onestopsystems.com/blogs/one-stop-systems-blog/evolution-of-artificial-intelligence
• https://www.forbes.com/sites/janakirammsv/2022/03/14/5-ai-tools-that-can-generate-code-to-help-
programmers/?sh=6d69596f5ee0
• https://home.dartmouth.edu/about/artificial-intelligence-ai-coined-dartmouth
o Tutorials:
• https://www.guru99.com/machine-learning-tutorial.html
• https://www.toptal.com/machine-learning/machine-learning-theory-an-introductory-primer
• https://www.geeksforgeeks.org/getting-started-machine-learning/?ref=leftbar-rightbar
• https://intellipaat.com/blog/supervised-learning-vs-unsupervised-learning-vs-reinforcement-learning/
• https://www.geeksforgeeks.org/what-is-reinforcement-
learning/#:~:text=Reinforcement%20learning%20differs%20from%20supervised,to%20perform%20th
e%20given%20task.
o Books:
• A Course on Machine Learning http://ciml.info/
• Deep Learning http://www.deeplearningbook.org
76
ML Intro: Applications
o Code Generators:
• Codex (code generation):
• https://openai.com/blog/openai-codex/
• https://www.youtube.com/watch?v=SGUCcjHTmGY
• GitHub Copilot (code generation):
• https://github.com/features/copilot/
• Tabnine (code generation):
• https://www.tabnine.com/
• CodeT5 (code generation):
• https://blog.salesforceairesearch.com/codet5/?utm_source=thenewstack&utm_medium=
website&utm_campaign=platform
• Bubble:
• https://bubble.io/
• Chat-GPT:
• https://www.youtube.com/watch?v=JTxsNm9IdYU
• https://www.youtube.com/watch?v=zpRM25pUD8w
77