Overview to ML

What do you think is common between Tesla cars and linear regression? Tesla, an automobile that executes highly complex Deep Learning algorithms while running nearly 60miles/hr with such great accuracy and speed while linear regression is basically a best fit line😂(with all due respect to LR).

The answer has to do with the smallest unit of each machine learning or deep learning algorithm. As we have, “the smallest unit of matter is an atom.”

In this post, we'll understand the different concepts and algorithms of machine learning and how they came up. This is an intuition-based approach. In short, it helps us learn how and why a particular algorithm occurred and connect links between different concepts.

# Description

  • Applications of Machine Learning.
  • An intuitive approach to machine learning (learning while doing).
  • The smallest unit for machine learning.
  • How to decide which Algorithm/Model to choose.

Before directly jumping into the topic let's first look around into the application of machine learning, so as to get our wondering minds into the ML world.

# Applications of Machine Learning

To put it simply, it is everywhere,
  • Right from your Snapchat, to the Instagram feed,
  • the complex Tesla cars, to one of my favorite Googling... for MCQ's (😈😏)
  • Predicting the rise of covid-19 3rd wave, months ago.
  • Grammarly helping me in writing correct Spellings for this post.

and we can have many more…

# Learn while doing

Assume we want to solve an environmental problem or say we want to create a self-driving car.

Let's try to come up with an algorithm that can do this.

If we are trying to create a car that can drive as Humans do, it's obvious that it must have capabilities like Humans, i.e. our code should be such that —

  1. It could Learn from its Past Experience
  2. In our case, this means that the car (Algo) should remember or learn from its past experience like

    This particular case is known as —

    Supervised Learning

    In these, our algorithm learns from the given Question/State/Situation and their respective answers. And when in future it finds questions, based on its learnings it is able to tackle the Situation.

  3. Group similar objects
  4. It's obvious that we are not going to write some code to deal with BMW cars and a different code for Ferrari, I know it may sound dumb but, self-driving cars have no idea about the relationship between BMW and Ferrari or even to a Pedestrian or Animals.

    My point is, we have to come up with an Algorithm that can identify that BMW, Ferrari, etc falls into the same Category while Animals and Padstrian fall into a different category so as to take decisions respective to their particular categories.

    This is known as -

    Unsupervised Learning

    In this case, we are not provided with any solution/Labels and are supposed to cluster together objects based on certain types of similarities. The similarity could be based on any attribute like color, shape, distance, etc.

  5. Handel Large Number of Uncertainty
  6. From the point so far, there are many variables to watch out for, such as searching for different types of objects, classifying them into groups, handling different types of weather conditions, handling wet and muddy roads, there are other speeding cars , and so on. There are so many variables to watch out for. And it is impossible to write code that handles all these scenarios.

    Therefore, we are supposed to create an algorithm that can learn things on its own, without writing code for each aspect.

    This is known as -

    Reinforcement Learning

    In this, we write an algorithm that will provide a particular type of reward for doing a particular action. For example, there is a left turn but the car took a right turn then we will give the car (Algo) a -ve reward, while if it took a left turn it will be awarded a +ve reward. So basically our algorithm will try to reduce -ve reward and try to get +ve reward and in this process, it learns to act into different situations. (Obviously, in real life we can not let a car learn like this so we do this process in a simulation).

# Structure of Algorithm

# Smallest Unit

Now that you know the different approaches to machine learning, let's answer the following questions. What do you think is common between Tesla cars and linear regression?

So for every problem to solve, there is some input to be given to the algorithm to learn from. This input as know is known as data. This data can be viewed as a CSV or a graph.

So the answer is that in every ML algo on the smallest scall we have to -
  1. Either come up with a line that can follow the pattern in which data is distributed.
  2. To come up with lines that can distinguish the different clusters present graph.

Whether it is Supervised, Unsupervised, or Reinforcement Learning behind the scenes they all are trying to create that line. In a way, we can call this line a Decision Line/Boundary.

Decision Boundary can be of two types —

  1. Linear
  2. Non-linear

As you know, in the end, we need to choose an algorithm that generates this decision line/boundary to solve the machine learning problem.

But, now that we know the different algorithms to make decision Boundaries!!

To Know which Algorithm/Model to choose, ask yourself these questions
  1. Which type of problem you are solving?
    • Is it a Supervised, Unsupervised, or Reinforcement Learning Problem?
  2. Ask yourself what is the Target about?
  3. Is your Data Linearly separable or Non-Linear?

# Conclusion

We have seen how we can intuitional approach to the Supervised, Unsupervised, and Reinforcement Learning Algorithms. We have also seen that whether it's a Neural network or Linear regression the same method is applied at a smaller scale. Finally, we learned steps to choose a better Model/Algorithm.