Offcanvas

The Intelligence of Machine Learning - Part 2

The Intelligence of Machine Learning - Part 2
intcore
By:

A couple of months ago, we started a topic about Machine Learning, we specifically talked about Linear Regression Algorithms and how linear regression can predict the price of the house based on a previous housing data.

You can find more about this in here “The Intelligence of Machine Learning - Part 1”.

Moving to the next thing we’re going to talk about, Detecting Spam emails, something that will tell if an email is spam or not and how we do this. In order to do so, we need previous data (training set). Given for example a hundred email that we looked at already, out of these hundred emails we’ve flagged some of them as spam, and the rest are not.  

Thinking about some features that spam emails may be likely to display and analyze these features. One of those features maybe containing the word “Cheap”. 

Let's assume that we have 25 spam emails and 75 non-spam emails. By analyzing those emails and looking for the word “Cheap” in them, we found that 20 spam emails contains that word, and 5 non-spam emails contains this word also. so, if an email contains the word “Cheap”, the probability of it being a spam will be (number of spam emails contains the word “Cheap” divided by the total number of spam emails). 

Applying this on our situation, we will find that the probability of an email containing the word “Cheap” being a spam email is 80%. So, we can associate this feature (contains “Cheap” word) with a probability of 80% and we can use it to flag future messages  spam or not.

Based on the previous example, We can also look at other features to specify a spam email such as Missing titles, spelling mistakes, etc.

This is known as “Naive Bayes Algorithm” or “Naive Bayes Classifier”.

Recommending Applications:-

Gender

Age

Application

Male

15

Pokemon Go

Female

25

HaYaChat

Male

32

HaYaChat

Female

12

Pokemon Go

Male

17

Pokemon Go

Given the above table, It seems that age is more decisive for predicting what will users download, for simple demonstration, we can use this algorithm, 

If user < 20, then recommend Pokemon Go.

If user > 20, then recommend HaYaChat.

We end up here with what is called “Decision Tree” and the decision are given by the question we asked, and these decision trees are built with data, and now when we have a new user, we can put them to the decision tree and recommend them whatever app the tree suggests is to recommend.

To wrap things up...

We this time we have talked about Naive Bayes Algorithm and decision tree algorithm with a couple of examples. next time, We’ll talk about Logistic regression and its usages. Till then, see you.

People liked
5 Tips for Choosing a Domain name
5 Tips for Choosing...

Plenty of people believe that a domain name is just an address for their website but in actuality it’s a lot more than that. Domain names have an immense impact on the amount of traffic your site gets, the click through rate, offline advertising, etc.

10 Essential apps for entrepreneurs
10 Essential apps fo...

Every entrepreneur has a million things to do daily, so today we are going to tell you about 10 essential apps that every entrepreneur should have on his mobile phone that would save them a lot of time and effort.

5 Essential Questions to be asked!
5 Essential Question...

Today we've covered for you the main 5 questions you should ask yourself before starting in the mobile app development process for your business!

How to measure your work on social media
How to measure your...

Can you measure the success of your work? As a business owner can you evaluate your social media specialist? There are so many of the social media specialists who don't know how to measure their work.On that base, they lose two things. First, they don't know where they stand, when they need to improve and if what they do have good results or not. Second, they lose their clients because they don't know how to display their work with results so the client has one solution only which is canceling the contract and searching for another social media specialist who gives a full detailed report at the end of every month.

Offcanvas Title
Your content here.