Commonly used Prediction Models in Machine Learning? Explain Each Model and How it Works?
Regression models are a type of machine learning model used to predict.
It tries to find a relationship between columns.
Regression Models are ready-made mathematical formulas created to make life easier.
1. Linear Regression:
Linear Regression is a model that checks whether there is a relationship between two or more columns. The relationship means: if one column value increases, will the other column value also increase or decrease.
If you study more hours, your marks will increase.
If you have more work experience, your salary will increase.
Example:
Students Mark - It can change over time, It is a Numerical score.
Sales - It can change over time, It is a Numerical Count.
Temperature - It can change over time. It is Number based.
Here is a Simple Linear Regression Graph:
If you have a Students Marks & Study time data for past 1 year, you can predict future marks using Linear Regression.
2. Logistic Regression:
It is used for Predicting binary outcomes - Means there can be only 2 Answers to find.Example:
Yes or No - it can be used to check if employee will leave job or not.
0 OR 1 - 0 = No, 1 = Yes.
Pass or Fail - Will Student pass future exams
True or False - Can we expect rain tomorrow?
Approved or Rejected - Can we give loan for this customer?
Here is a Simple Logistic Regression Graph:
It is predicting whether a Loan can be approved or not based on Customer details.
3. Decision Tree:
It is used to make decisions step by step at multiple levels to reach final answer.Example:
Here you can See Google Map predicting based on Decision Tree and Coming to Final Answer.
4. Random Forest
What is a Forest?A Place having Many Trees Together is called Forest. Right?
Random Forest is using Many Decision Trees together for better Decision Making.
Each Decision tree will give its Best Answer and Majority is considered Final Answer.
Example:
Now, this is called UFO - Unidentified Flying Object.
Military noticed this in Sky. But Not sure if that is a Drone, RC Plane, Alien Object or Balloon. They want to use Random Forest method to find it.
Here you can See Random Forest Chart using multiple Decision Trees to predict.
5. Support Vector Machine (SVM)
It is used to find a best separating Line between two groups, so we can predict which group a future value belongs to.Look at this image.
You can see SVM Model has Separated Data into three types based on Color.
There are lines separating the data groups. These lines are called Hyperplane.
Example:
SVM will draw a Line between Disciplined Students and Undisciplined Students based on their behavior data.
When a New Student Joins the college, this Model will be able to predict in few months whether this new student will become a Disciplined Students or Undisciplined Students.
6. K-Nearest Neighbors (KNN)
So, who is Neighbors?
The People who live nearby you, your area is called neighbors.
Someone who is near you or next to you is also called Neighbor.
Now, What is K - Nearest Neighbors?
Number of nearest neighbors to your home.
KNN Algorithm is used to predict a new data based on the similar existing nearby data.
Example:
There are 100 employees working in your Company.
There is a new Employee Joining your company and you want to predict whether he will perform well or not in future based on his current activities.
You will ask KNN model to find this.
KNN Model will compare this new employees activities with old employees and give you answer.
If the new employees behavior matching more with Disciplined employees in your company, then KNN Model will tell you the New Employee will become Best Employee in future.
Same Way,
If a new student joins College, KNN will compare him with some old students habits in the past with same attendance record, marks, behaviors.
Then it guess whether this new student will be disciplined or not, based on comparison result from similar students.
7. Naive Bayes
What is Naive?"No experience of life but ready to believe or trust other people"
A Naive Person trust everyone equally even though there are Good Vs Worst people in real life. They Don't Judge others.
That is how Naive Bayes Model also work.
To Explain how Naive Model works, we need to understand how other models work.
Example:
You have student Data with their behavior, attendance marks etc..
Now, Other Models will give importance to Each Column based on how important the Column is Linked to Marks.
As you can see here, Column Attendance, Punctuality, Discipline - All these have Ups and Downs.
Ahmed has Low attendance, but still scored 91 Marks.
Anusha has good Punctuality but still scored 57 marks.
Vinoth has Good Discipline, but still got 58 Marks only.
So, Other models will not give much important to these Columns.
If you look at Study time Column:
Whoever studied more time got more marks.
Whoever studied less time got low marks.
Simple as that.
Now, Other Models will give more importance to Study Time Column, because Study time has more impact of Marks.
This is how other Models Work. But Naive Bayes gives equal importance to all Columns in the File.
It gives equal importance to all the Columns Starting from Attendance to Study time and make decisions.
This may not be useful for Student marks, Employee Performance etc.. But this is Very useful for finding Spam Emails, Fake Emails, Fraud Detection etc..
Because in Criminal Data, we need a Model that gives equal importance to all the Columns. Because even One column can give us Important Hint!
Here you can see Naive Bayes Model showing Student data using Line Chart
8. Time Series Models (ARIMA, Prophet, etc.)
It is used to predict future values based on historical time based data. This Model study past month to month, year to year like data and predict how much you will score in future.
It is Time Series Forecasting.
Example:
A student writes one test every week and you are tracking his marks.
Now you want to predict Week 8 marks using this pattern from past weeks.
You are using Time Series Model (like ARIMA or Prophet) and it looks at the trend and time order of marks and predicts the next value.
Result:
Based on the pattern, the model may say:
Week 8 Marks = 78 (predicted)
You can use any Chart like Line Chart, Bar chart to show your prediction.
9. Neural Networks / Deep Learning
This Model works like a human brain connecting neurons together and making decisions or future predictions.
Our brain has billions of Neurons, they are all connected together to keep your memory active, keep your experience and life lessons within you.
You are learning about life, people, Government and making Correct decisions and Correct Judgements with the help of these neurons.
When you more Past Experience, you can make Correct Decisions.
Now,
This Machine Learning Model also uses Artificial Neurons to make correct decisions and predict future correctly.
When you have More Past data, It is best for this model to do correct prediction.
Simple Example:
Your Hospital wants you to Create a Model that predict whether patients has Diabetes or not, based on the following information:
Age
Weight
Sugar level
Blood pressure
Family history
Exercise habit
You collect thousands of patient records with these details and whether they had Diabetes = Yes or No.
Now, you train the Neural Network model like this:
The model sees one patient data:
Age = 45, Weight = 85kg, Sugar = High, Diabetes = Yes.
It passes this data through many layers of artificial neurons. Each neuron checks for some pattern or condition.
The model learns slowly:
If blood sugar is high and weight is high, then more chance of diabetes.
If exercise is regular and Normal Weight, then less chance of diabetes.
It makes more predictions like this.
After seeing thousands of examples, the neural network starts understanding patterns in health data.
Now, if a new patient comes, the model checks that person health details and predicts
Example Outcome:
This person has 85% chance of becoming diabetes patient in future based on his lifestyle and body condition. If he reduce weight and do exercise, it can be avoided.
Even if Someone has very good life style and healthy habits, this model can find where they are making mistake and what can contribute to diabetes.
How is it possible?
After seeing thousands of examples, the neural network starts understanding hidden patterns in health data.
When you give more data, more columns, more information to this Model. This Model will use More neurons for calculation and give a better Answer.
10. XGBoost / LightGBM / CatBoost
These are powerful machine learning models mainly used for prediction , especially when your data has many columns (features) and you want high accuracy.
They are called Boosting Models . They work by using decision tree again and again until it reach correct answer.
One by One each comparison, Decision is analyzed. Every time this analysis happens, the decision becomes more Accurate.
Example:
Teachers Checking Student data.
Teacher 1 says: “Maybe he’ll fail.” (15%)
Teacher 2 says: “Wait, he improved attendance, maybe not.” (60%)
Teacher 3 says: “He also did well in assignments, I think he’ll pass.” (100%)
Final answer: Pass
Comments
Post a Comment