00:00it can be either a step activation function or it is a threshold activation function.
00:05So, here we are taking a threshold activation function and what is the threshold that we
00:10have fixed? The threshold that we have fixed is 3. Now, what is the summation value that
00:15we have got? The summation value what we have got is 4.4. Now, that is being compared with
00:20the threshold. What is the threshold value? The threshold value is 3. Since the summation
00:25value s that we have calculated is greater than or equal to a threshold value, the output
00:33is 1. If the value for example, if there is some input value and if you multiply it with
00:42the weights, if those if the resultant value is less than the threshold, then the output
00:47will be 0. Since here for the example that we have taken, the value summation value is
00:534.4 and the threshold value is 3. Since the summation is greater than a threshold value,
00:59the output of this is 1. So, what is 1 here? What is our problem statement? Since it is
01:06a binary classification. What is the binary classification? Whether it is 1 or 0? 1 is whether it is a
01:12spam
01:13and 0 it is not a spam, not a spam. So, here the output what we have got is 1.
01:21Therefore,
01:21maybe this particular input is classified it as it is a spam. So, this is how a simple working
01:29mechanism. Our model has classified it as a spam. The output what we got is 1, but what if
01:35the output the correct output was 0? So, that means something went wrong in this entire. What would
01:42have gone wrong? Input is something that is given to us. So, we cannot do any changes with the input.
01:48So, in this entire process there is something that we have assumed. What is that we have assumed? We
01:55have assumed these weights. Weights are something which is not given to us in our data set. Go back
02:01and then imagine a data set. A data set will have only the features and you will have and if
02:07it is a
02:07supervised one, you will have a target labels. But the weights are something that we are assuming.
02:12So, if the weights that what you have assumed is wrong, then definitely the output what we are going
02:18to get will be an incorrect output. The prediction made by the model will be an incorrect prediction.
02:24So, therefore, here comes the learning algorithm. The most important concept which we are going to
02:30study next will be the learning algorithm. So, what exactly happens here? Suppose if there
02:37is a misclassification. So, what we have assumed? The weight weights are something that we have
02:43assumed and there is a bias term. We have taken some constant value, maybe that constant value
02:48what we have assumed also was not a correct one. Then we have to come back and then change these,
02:53update these weights that is done by an algorithm called perceptron learning algorithm. One of the
03:01most important concept I request the learners to focus here, perceptron learning algorithm.
03:09So, before we get into what is the very first step that we require? We require an input which means
03:15we have x1, x2 and so on up to xn. So, we need an input. Then we are going
03:23to assume certain weights for each of the input. If you have 5 inputs, there will be 5 weights
03:29associated with each of this. So, you need to set the very first step is you need to set the
03:35weights
03:36and then you should also assume the bias. You should also set a bias and these are randomly initialized.
03:44And there is also something called as a learning rate eta. We are also choosing one random value
03:53which is a learning rate. Let us see what is the role of this. So, once this is done. So,
04:00once you initialize the weights bias, what is that we are going to do? For each of the input,
04:07we are first going to calculate the, this is the first step. For each of the input values,
04:13we are computing the summation, the weighted sum. How is that we are going to do? It is x into
04:20wf
04:20and if you have multiple, it is x w transpose x. This is the first weighted sum that we are
04:27going to
04:27perform. Once we calculate the weighted sum, the resultant of this is being passed to an activation
04:34function. So, here the activation function as I said, either it can be a step activation or it can be
04:39an activation activation activation. So, what exactly the role of an activation function?
04:45Whatever is the resultant of this summation value? If it is greater than or equal to a threshold,
04:52we get a value 1. If it is less than a threshold, we get a value 0. Now, once we
04:57calculate this
04:58threshold, then whatever that is the ultimate output that we get. Now, whatever is the output
05:04that we have obtained, we call it as an predicted output or we call it as an computed output. So,
05:14it can be any one of this you know terminology. Now, for every of the input, there is an ground
05:22truth,
05:23there is something called as an target for every of the input. When you consider your data set,
05:31you will have during a training phase, if it is a supervised, it is a supervised data set,
05:37supervised learning data set where you will have a label. So, for every of the input, you will have
05:43an associated label already, right. So, now, you have passed the first sample, you have passed the first
05:51sample and the model has predicted something. Let us assume it was supposed to be 1, but the model
05:58has predicted it as 0. Now, when model has predicted it as 0, what is the next step that we
06:04do? We are
06:04going to calculate the error. What is why is that we need to how is that you calculate and why
06:10is that
06:10we need to calculate it? Because our ultimate aim is the model has to predict a correct output. What is
06:17the correct output here? The correct output is 1, but what is that our model has predicted? The model
06:22has predicted it as 0. So, it is an incorrect prediction. So, what is that we will do? How is
06:27that we
06:27will get to know that it is incorrect prediction? So, we calculate an error. What is the formula
06:32that we that is used to calculate? It is a target minus computed. What is the target? The ground truth
06:38is already known to us, target is 1. And what is computed? Computed is something which the model has
06:44predicted 0. So, the result what we are getting is 1. So, because there is an error. Now, what is
06:52that
06:52we do? We come back. And once we come back, what is that we have to, why is that you
06:57want to come back?
06:58You are going to update.
Comments