MachineLearning Lecture 2
MachineLearning Lecture 2
Source: https://vitalflux.com/dummies-notes-supervised-vs-unsupervised-
learning/
Machine Learning Approaches
Supervised learning (predictive models):
• Learning with a teacher
• Each example in the dataset is associated with a label (i.e., target output)
• Train dataset {𝑥, 𝑦} where 𝑦 ∈ {+1, −1} is provided to learn the function 𝑓.
• Examples:
• Iris dataset: 150 iris plants, features (sepal length, sepal width, petal length and petal width), three
classes (Iris Setosa, Iris Versicolour, Iris Virginica)
• Available online: https://archive.ics.uci.edu/ml/datasets/iris
Machine Learning Approaches
Supervised learning (predictive models):
• The network then processes the inputs and compares its predicted outputs against the desired
outputs.
• If the resulting output differs from the desired output, the generated error signal adjusts the
weights.
• The error minimization process is supervised by a teacher.
Machine Learning Approaches
Unsupervised learning (descriptive models):
• Experience a dataset containing many features, then learn useful properties of the structure of
this dataset.
• Given a dataset {𝒙" , 𝒙# , … , 𝒙$ } without labels
• Extract the hidden structure to group similar data points (Clustering algorithms)
• Unsupervised learning algorithms:
• Self-organising features map (SOM)
• Principle Component Analysis (PCA)
• …
Machine Learning Approaches
• Unsupervised learning (descriptive models):
Decision trees
Bayes theorem
• MNIST (Mixed National Institute of Standards and
Technology) dataset of handwriting digits.
Performance of • 60,000 training and 10,000 test instances of hand-written
digits.
ANNs • Each image is encoded as 28x28 pixel grayscale images
𝑫
𝒂𝒄𝒕𝒊𝒗𝒂𝒕𝒊𝒐𝒏 𝑠𝑐𝑜𝑟𝑒 = 𝑎 = ? 𝑥𝒊 𝑤𝒊
𝒊&𝟏
If the activation is greater than a predefined
threshold, then the neuron fires.
Bias
• We need to adjust a fixed shift from zero, if the “interesting” region happens to be far from the
origin.
• Bias allows shifting the activation function by adding a constant (i.e. the given bias) to the input.
• Bias in Neural Networks can be thought of as analogous to the role of a constant in a linear
function, whereby the line is effectively transposed by the constant value.
• Lets adjust the previous model by including a bias term 𝑏 as follows:
*
𝑎 = 𝑏 + ? 𝑥) 𝑤)
)&"
• By adding a feature to each data points that is always equal to 1 (𝑥+ = 1), we can include the bias
term 𝑏 into the weight vector (i.e., 𝑤+ = 𝑏)
*
𝑎 = ? 𝑥) 𝑤) = 𝒙, 𝒘
)&+
Perceptron Training
Activation Functions
• The purpose of an activation function is to ensure that the neuron's response is bounded
• that is, the actual response of the neuron is conditioned or damped, as a result of large or small
activating stimuli and thus controllable
Activation Functions (Cont.)