unit 2_class_preceptron
unit 2_class_preceptron
Classification Accuracy:
Accuracy = (TP + TN) / (TP + TN + FP + FN) = (3+4)/(3+4+2+1) = 0.70
Recall: Recall gives us an idea about when it’s actually yes, how often does it predict yes.
Recall = TP / (TP + FN) = 3/(3+1) = 0.75
Precision: Precision tells us about when it predicts yes, how often is it correct.
Precision = TP / (TP + FP) = 3/(3+2) = 0.60
Types of supervised ML algorithms
oLinear Regression
oRegression Trees
oNon-Linear Regression
oBayesian Linear Regression
oPolynomial Regression
classification
Classification algorithms are used when the output
variable is categorical, which means there are two
classes such as Yes-No, Male-Female, True-false, etc.
oRandom Forest
oDecision Trees
oLogistic Regression
oSupport vector Machines
Supervised model types
Linear Regression Models
Least squares, single & multiple variables, Bayesian linear regression
Logistic regression
Each time a dataset passes through an algorithm, it is said to have completed an epoch.
Therefore, Epoch, in machine learning, refers to the one entire passing of training data
through the algorithm. It's a hyperparameter that determines the process of training
the machine learning model.
Perceptron – Activation function
Activation function will help to determine whether the neuron will fire or not.
Activation Function can be considered primarily as a step function.
Types of Activation functions:
oSign function
oStep function, and
oSigmoid function
Perceptron Model ( algorithm)
Step-2
In the second step, an activation function is applied with the above-mentioned
weighted sum, which gives us output either in binary form or a continuous value as
follows:
Y = f(∑wi*xi + b)
Perceptron training rule
Perceptron_training_rule (X, η)
initialize w (wi an initial (small) random value)
repeat
for each training instance (x, tx) ∈ X
compute the real output ox = Activation(Summation(w.x))
if (tx ≠ ox)
for each wi
wi wi + ∆𝑤𝑖
∆𝑤𝑖 η (tx - ox)xi
end for
end if
end for
until all the training instances in X are correctly classified
return w
Single vs Multilayer perceptron