A0

Labels

2) Linear Regression Model

 Linear Regression Model

This is the type of Supervised Learning Algorithms. Here we will predict a value after getting some inputs. We have some features x (if you have multiple features then x will become x1, x2, x3 and so on)as input. We will take these features and feed them to a trained model and our model will predict a value as output. In this way linear Regression Model works. Now let’s try to go in depth of model.
If we break the model as initial stage then it will be like this
Feature (x) — — — — — — — — → Model (f(x)) — — —— — — — -> Prediction (y)
Here f(x)= w*x +b, Maybe you are thinking what is this so let me explain. Here w is some weight, x is feature and b is bias. Let’s assume you bought 3 eggs (egg is feature) and price of a egg is 10 rupees (here price is weight and bias is 0(you can also take 1 as a bias). We know that weight and bias can be high or low according to the situation) Now let’s predict the price of egg as output by putting detail in the equation which we named as model
w=10; x=3; b=0
f(x)=w* x + b — — — — — — — — — -> 10 * 3 + 0 — — — — — — — — — -> 30 (this is prediction which we can say y)


Our actual price of eggs (actual-y) is 30. This means that we have 2 y’s first one is predictive y and second one is actual y. Predictive y denotes to that price which we predict by our own with the help of our model using that information which we have. And actual y denotes the actual or real price of eggs according to the market. After comparing the actual y with predictive y if both are near to each other means about the same then our model prediction is good if they are not same or near to each other then our model prediction is not good. Like other mathematic scenarios we should have some equation to measure this error between actual-y and predictive-y and here it is, to measure this error we have a method called cost function. formula is given below. 


Here n is number of training examples and Y[i] is actual value and Y^ is predicted value. We will put the values inside this function if output will be close to zero then our output is accurate otherwise we have to change the parameters (weight and bias) to make prediction accurate. Now maybe you are confusing how parameters (we are using parameter word for w and b)are changing, actually for training purpose when we are trying to train the model with the help of features x then we will check the actual-y with predictive-y at every iteration every error is high then we will change the weight and bias or update the weight and bias according to the situation. There are lot of the techniques to update the weights and bias for now you have to take the overview of the concept. We will cover the complete process how model trains itself in upcoming tutorials. At this stage you should familiar with Gradient Decent technique to update the weights and bias. Formula to update weight and bias using gradient decent is given below

Gradient Decent

Here alpha is learning rate which is also a parameter. You have to set the learning rate accurately. If Learning rate will be too small then weight and bias will update slowly toward target weight and bias (target weight and bias is that value where your model will predict the right output). If Learning rate alpha will have very large value them may be we cannot reach toward the target weight and bias. So you have to set the right value for learning rate so that our model will learn accurately and predict right value.
Learning rate

Example of Linear Regression using Single Neuron:

Linear Regression

This Diagram shows the method of prediction that how model predicts the value. For today’s blog your understanding for predicting values should be clear.








1) Machine Learning

 Machine Learning

Introduction:

Machine Learning is the subset of Artificial Intelligence. Now a days this is very buzz word. If you ask from anyone what do you want to become than most of the people answer it as Machine Learning Engineer. This is not easy as sound like here you have a huge grip on Math and stats to become a good ML Engineer. Actually, This is explicit program which Help us to get label or predict label, recommend videos to anyone according to his/her searching data, predict spam email or not etc. There are various things which are using Machine Learning such as  Self Driving Cars, Speech Recognition Systems and Google Maps etc. There is another buzz word called General AI which helps us to act the AI like Humans.

Machine Learning Types:

ML is explicit program to create intelligence e.g while playing checkers ML Algorithm works better as much as ML Algorithm gets the Data. There are some types of Machine Learning Algorithms which are Given Below: 

1) Supervised Learning (It is using in real life applications)
2) Unsupervised Learning
3) Reinforcement Learning
4) Recommendation Systems

We will choose the right tool for a specific problem after identifying the problem and after getting identification we can select the right algorithm.

1) Supervised Learning:

About 99% problems are solving now a days using supervised learning. e.g

                    => email     ------------->        spam(0/1)       ---------->              spam filtering
                    => audio     ------------->        text transcripts         --->              speech recognition
                    => English  ------------->        Spanish        ------------>              Machine Translation
                    => ad, user info    ------>        click(0/1)         --------->              online advertising
                    => image, radar info  -->       position of other cars  ->              self driving cars
                    => image of phone  ---->       defect(0/1)      ---------->              visual inspection

Regression and classification are the type of supervised learning. 
  => classification  problem predict categories (it should not be number). For example you are classifying the two categories for email like spam or not spam. You can say class A is spam and class B is not spam. In classification problem your model will be able to tell the difference between these two classes after training. You should not limit the categories I choose the example of binary classification because here we are dealing with 2 classes which are spam(1) and not spam(0). There can be multiple classes in the classification problem. (Here I have one of the most important point which is your model can only understand the numbers. You have to convert everything into numbers e.g images, text). Here we also have to convert the categories into numbers like 0 and 1 if you have more than one category then convert it into 0,1,2,3 on so on. This is really a fun.

Classification

  => Regression problems predict the infinitely possible numbers. This is also one of the famous type of supervise learning. Here we can take the example of House Price Prediction System where you have to estimate the price of the house and this can be infinite possible numbers. Here you are not dealing with categories or classes here you are dealing with numbers. You will feed the training x features (features are attributes of the house like location, size, rooms, bathroom etc.) to the model with training y feature of the model price. After feeding the data your model will start finding the pattern by adjusting the parameters weight and bias(we will see the whole mechanism later in the blogs which can help you understanding the whole mechanism). Here weights and bias will adjust in this way that when features x will multiply by weight (w) and add with bias (b) you will get your predicted price (y=w*x+ b). I know this is little bit hard to understand at this stage but don’t worry we will cover every thing in detail later. We will also understand the model training mechanism, testing mechanism ans so on. I will also provide you the code which can help you for better understanding.

Regression



2) Unsupervised Learning:

Here we find something interesting with unlabeled data e.g clustering, k-mean etc.
Note: Google also use clustering in Google News to show related articles by finding similar tags or words.
Here you do not has input x with output y to train model so here we find structure in data by clustering, anomaly detection(find unusual data points), dimensionality reduction(compress big data set to small one using fewer number).

Supervised vs Unsupervised


Note: Remaining two types of Algorithms we will write in upcoming tutorials