Introduction To Machine Learning

Mukul Malik
HackerNoon.com

--

Machine Learning, we all have heard it and heard it ears full. Yet we hesitate to get a hang of it.

“The only stupid question is the one you don’t ask”

So let’s ask a few fundamental questions

Q) Is Machine Learning Rocket Science?

Ans) No, it is used in Rocket Science though.

Q) Why is it that we are scared to take a peek into it?

Ans) Maybe what it does seem like a miracle to us. So we assume it is something out of our scope of learning/understanding.

Q) How tough/complex is it?

Ans) Anyone who has dared to fight this hydra knows that it is a child’s play (well that was an understatement but you get the idea).

Q) So what is it?

Ans) It is an attempt to make things more intelligent. Most of us have come across terms like “Artificial Neural Networks”, it is an attempt to replicate the working of the human brain. Even something like this is not necessarily always complex. At its heart, it is just multiplication and differentiation. Yes, Maths at it again but it’s rather what you learned at school, no different (This coming from a guy who is petrified of maths).

Q) What does intelligent mean?

Ans) Understanding concepts or patterns behind the working of something. It could be understanding Emotions, making sense out of Human Languages (Ex: English , Hindi , French) and cool stuff like predictions.

Q) So what can it do?

Ans) Well Everything that a human can and a lot more. Some applications are really (Really REALLY !!) cool.

Q) Ok …. ? Like what?

Ans) Consider Following

1) Like predicting most relevant option out of a billion choices on eCommerce websites.

2) Remember Tinder? Well for all those who have found a Hot Match, thank you Machine Learning!

3) Netflix uses it to guess your mood and recommend the movie that you will be most interested in.

4) Google uses it to guess the most relevant page out of a billion (even a few hundred billion) results.

5) It is being used in Medical field to predict diseases like Cancer before a person actually gets infected by it. Goosebumps anyone?

6) My personal favorite : Cortana and Siri type language understanding bots.

7) Everything!! :D

Now let’s dive a bit deeper

Netflix

  1. It has a genre tagged to a respective movie. Example : Star Wars is tagged adventure (OFC it is Aventure!). It also has a few other tags like actors, director, production houses, description, runtime etc.
  2. Now when you watch a movie, it records all the above info plus some extra info depending upon your reaction. Reactions like : How much of it did you watch? How many times did you pause it? Now it finds patterns in your behaviour.

So it funnels down the result something like this:

  1. You like X genre -> 100 options
  2. You like Y actors -> 50 options
  3. You don’t like very long movies -> 10 options
  4. You mostly prefer animated movies -> 5 options

Now these 5 options are the recommendations it will pitch at you but it doesn’t stop just there.

You usually watch movies between 6 P.M to 10 P.M -> Schedules recommendation

You usually watch scary movies before sleeping -> Prioritizes scary movies near 10 P.M slot

Google (Text Analysis)

  1. Everything from the suggestions that Google displays when you start writing a text to the actual results that Google displays use machine learning. It uses NLP or Natural Language Processing. Natural languages are the languages humans use to communicate with each other.
  2. It understands language by converting text into vectors. (Yes the concept perplexed me too the first time I heard it) Think of word vector as a matrix of size N. N depends usually and roughly on the number of rules in a language under analysis. Example English is inferred to have rules between 300–400. So every variable in the matrix points towards a rule.

Q) Now the question is what value should be given to which rule?

Ans) I don’t know! :D

Q) Why am I so excited about not knowing the answer?

Ans) Because this is the power of Machine learning! It automates this process.

These vectors contain semantic meaning. Semantic means the context.

Results almost made me do the Archimedes.

Example : Consider 3 sentences

  1. Messi scored a goal
  2. Ronaldo missed the last penalty
  3. Mukul missed his sleep

Now the traditional learning would infer that sentence 2 and 3 have a same word ‘missed’. Rest no similarities. So 2 and 3 are closer. Stupid, right?

Whereas our brain knows that 1 and 2 are used in same context which is sports or football precisely.

BTW so do our Vectors ;)

The vector of Ronaldo will have a value much closer to the vector of Messi. So when we find the similarities between the sentences using vectors we get 1 and 2 are the closer ones. Smarter, right?

Q) So a matrix of numbers can understand the language and the context? :O

Ans) Yes, rainbows in your eyes and wide open mouth are normal at this point ;)

--

--

Mukul Malik
HackerNoon.com

Manager Data Science at PublicisSapient (NLP & Deep Learning Specialist)