## DEV Community

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

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

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

Lets learn from an example

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

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

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

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 .

Now, lets learn another way called Classification

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

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

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

Depending on the output, we can draw points

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

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

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

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

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

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.

Basically it divides the data into clusters

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

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

Again, here is another example of DNA Clusterng

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.

So, this is how we can cluster.

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

Therefore , we can say

In summary: creates different clusters by finding patterns