Fundamentals
Fundamentals
Fundamentals
Artificial Intelligence
(ME3181)
Fundamentals
Performance measure P
–percent of words correctly classified
Training experience E
–a database of handwritten words with
given classifications
Known Input
Computer Rule
Known Output
Model
Data
- Set of available data pieces = dataset
- Each data piece (point) is a sample or an example
- Data could be only input (unsupvised learning)
• Prediction Phase
New Input
Computer Predicted Output
Model
Applications of AI (ME3181) 4
Modelling from data
o Each feature can be represented in a variable 𝑥𝑖
o All the features can be represented in a vector of features:
𝑥1
𝑥2
𝑥 = … = 𝑥1 , 𝑥2 , … , 𝑥𝑛 𝑇
𝑥𝑛
o A label can be represented in the same ways.
o There are some special ways to represent labels and features for some
special problems
Applications of AI (ME3181) 5
Modelling from data
• Inputs: Features, Variables, Attributes, Covariates
• Outputs: Response variables, Labels, Tagets
https://www.amybergquist.com/
Applications of AI (ME3181) 6
Modelling from data
• Inputs: Features, Variables, Attributes, Covariates
• Outputs: Response variables, Labels, Tagets
Applications of AI (ME3181) 7
Modelling from data
• Inputs: Features, Variables, Attributes, Covariates
• Outputs: Response variables, Labels, Tagets
Applications of AI (ME3181) 8
Modelling from data
• Inputs: Features, Variables, Attributes, Covariates
• Outputs: Response variables, Labels, Tagets
Applications of AI (ME3181) 9
Modelling from data
• Inputs: Features, Variables, Attributes, Covariates
• Outputs: Response variables, Labels, Tagets
Features
Applications of AI (ME3181) 10
Modelling from data
https://www.linkedin.com/pulse/customer-segmentation-using-python-data-science-deepak-sharma
Applications of AI (ME3181) 11
Modelling from data
Applications of AI (ME3181) 12
Modelling from data
o Supervised Learning
o Dataset is the collections of labeled examples.
o Un-supervised Learning
o Dataset is a collection of un-labeled examples.
o Self-supervised Learning (Semi-Supervised Learning)
o Dataset included both labled and un-labled examples.
o The number of un-labled examples is usually more than that of labled
examples
Applications of AI (ME3181) 13
Modelling from data
o Supervised Learning
o Dataset is the collections of labeled examples.
o Un-supervised Learning
o Dataset is a collection of un-labeled examples.
o Self-supervised Learning (Semi-Supervised Learning)
o Dataset included both labled and un-labled examples.
o The number of un-labled examples is usually more than that of labled
examples
Applications of AI (ME3181) 14
Modelling from data
o Supervised Learning
o Dataset is the collections of labeled examples.
o Un-supervised Learning
o Dataset is a collection of un-labeled examples.
o Self-supervised Learning (Semi-Supervised Learning)
o Dataset included both labled and un-labled examples.
o The number of un-labled examples is usually more than that of labled
examples
Applications of AI (ME3181) 15
Modelling from data
o Supervised Learning
o Dataset is the collections of labeled examples.
o Un-supervised Learning
o Dataset is a collection of un-labeled examples.
o Self-supervised Learning (Semi-Supervised Learning)
o Dataset included both labled and un-labled examples.
o The number of un-labled examples is usually more than that of labled
examples
Applications of AI (ME3181) 16
Modelling from data
https://www.analyticsvidhya.com/
Applications of AI (ME3181) 17
Modelling from data
o Reinforcement Learning
o Learn a policy
Applications of AI (ME3181) 18
Modelling from data
o Batch Learning (Offline Learning)
• Trained using all the available data
• First the system is trained, and then it is launched into production and
runs without learning anymore
• Take a lot of time and computing resources
o Online Learning (Incremental learning)
• Data is feed instances sequentially, either individually or in small
groups called minibatches
Applications of AI (ME3181) 19
Modelling from data
o Instance-based Learning
• The system “learns the examples by heart”
• Then generalizes to new cases by using a similarity measure to
compare them to the learned examples (or a subset of them)
o Model-based Learning
• Build a model of the examples and the model to make
predictions
Applications of AI (ME3181) 20
Data Preparation
Test = Val
Applications of AI (ME3181) 21
Data Preparation
• Popular open data repositories
UC Irvine Machine Learning Repository
Kaggle datasets
Amazon’s AWS datasets
• Meta portals (they list open data repositories)
Data Portals
OpenDataMonitor
Quandl
• Other pages listing many popular open data repositories
Wikipedia’s list of Machine Learning datasets
Quora.com
The datasets subreddit
Applications of AI (ME3181) 22
Mathematical Concepts Review 1
Data structure
• Scalar: a simple numerical value.
• E.g.: 0, 1, 3.5, 2.5,…
• Scalar Variables are usually denoted as italic letters (𝑥, 𝑎, 𝑦, …).
• Vector (programing: array): ordered list of scalar values.
• The scalar values in a vectors are attributes or features.
• Usually denoted as bold letters x or w.
• Usually represented as column vectors.
• Lazy notation (in my lectures) : 𝑥 = 𝑥1 , 𝑥2 , … , 𝑥𝑛
• Can be represented as points or arrows
• Matrix: 2-D vector (lazy thinking)
• Tensor: Higher dimension vectors (lazy thinking)
Applications of AI (ME3181) 23
Mathematical Concepts Review 1
Operations
• Summation
• Production
Applications of AI (ME3181) 24
Mathematical Concepts Review 1
Function
Extrema: Minima, maxima
Applications of AI (ME3181) 25
Mathematical Concepts Review 1
Derivative and Gradient
A function 𝑓(𝑥)
𝑑𝑓
Derivative: 𝑓 ′ 𝑥 = 𝑑𝑥
𝜕𝑓
Partial derivatives (multi-variable function): 𝜕𝑥
1
𝜕𝑓 𝜕𝑓
Gradient: ∇𝑓 is a vector [ , ,…]
𝜕𝑥1 𝜕𝑥2
Chain rules:
Applications of AI (ME3181) 26
Mathematical Concepts Review 1
Random Variables and Probability
Applications of AI (ME3181) 27
Mathematical Concepts Review 1
Random Variables and Probability
Applications of AI (ME3181) 28
Mathematical Concepts Review 1
Random Variables and Probability
Applications of AI (ME3181) 29
Mathematical Concepts Review 1
Random Variables and Probability
Applications of AI (ME3181) 30
Mathematical Concepts Review 1
Random Variables and Probability
Applications of AI (ME3181) 31
Mathematical Concepts Review 1
Random Variables and Probability
Applications of AI (ME3181) 32