DEV Community

Cover image for Machine Learning A to Z: Part 1
Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on

Machine Learning A to Z: Part 1

Some machine learning Algorithms are

  1. Supervised ML Algorithm
  2. Unsupervised ML Algorithm
  3. Recommender systems
  4. Reinforcement Learning

Supervised ML Algorithm
This algo basically learns from input to output labels

Image description

Just see how these different Algorithms take inputs and gives which outputs

Image description

All of these models have training models and you train them with data.

Lets learn from an example

Image description
Depending on the size of the house, you want to know the price of a house.
Assume that you want to know the price for a house which has 150 square feet

Image description
Now , you may draw a straight line and get some value

Image description

But you can do some complex works too , to get most correct data.
If you create a curve, you can see the price changes and this time it shows even more from the past time

Image description
Ultimately, you will get a value but mainly this is how in supervise model, machine learns what should be the data. We will know more correctly later, which process you should pick . But for this type of problem, we will use Regression .

We will know about this terms in the later part of the blog

Now, lets learn another way called Classification

Image description

Mainly we will try to predict breast tumors based on sizes.

from a tumor, we can detect if it is malignant or not

Image description

Now depending on the size of the tumor, it can be cancer (Represented by 1) or not (0)

We can then create a graph with that
Image description

Depending on the output, we can draw points

Image description
As we have just 2 type of outputs, we can draw them on a line

Image description

Now, we later found that there are 2 types of malignant . So, we pointed them out and classified them in this manner

Image description

So, classification algorithms predict categories and they not only predict numbers. It can be non numeric like malignant or benign for this Breast cancer prediction.

Now if we also provide age with tumor size, the graph can be like this

Image description

The doctor can easily predict the age & tumor size from the graph

Image description

Also, from this graph, we can make a curved line to differ malignant patients & not benign patients

Image description

In summary: Analyzes data and creates a label. For example, finds if a patient is diabetes patient or not.

Unsupervised ML Algorithm
To find the patterns in data, we use unsupervised or Algorithm. For example, in supervised learning we tried to find if a person has cancer or not using tumor size etc . But in unsupervised learning, we will just find a pattern between them. We don't want to hear if a patient has cancer or not by providing the tumor size.

Image description

Basically it divides the data into clusters

Image description
For example, Google News uses clustering . Here you can see they have provided panda's news at headline and related other news in a cluster

Image description
So, what basically did is found the articles having the same sort of words

Image description
Again, here is another example of DNA Clusterng

Image description

Each row stores gene information of each person and each column has genes which control certain behaviour

Now, we can cluster these genes into Type1, type 2, type 3.........
We won't say the behaviours of each type. Just cluster them.
Image description
Image description

So, this is how we can cluster.

Moreover, we can have another example. We can have a clusters of customers.

Image description

Therefore , we can say

Image description

In summary: creates different clusters by finding patterns

Top comments (0)