0% found this document useful (0 votes)
13 views20 pages

7 Machine Learning Algirithms

Machine learning (ML) is a branch of artificial intelligence focused on developing algorithms that learn from data to perform tasks without explicit instructions. It has numerous applications across various sectors, including social media, e-commerce, healthcare, and self-driving cars, enhancing decision-making and efficiency. The ML lifecycle consists of steps such as data gathering, preparation, analysis, model training, testing, and deployment to create effective predictive models.

Uploaded by

zarryochola
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views20 pages

7 Machine Learning Algirithms

Machine learning (ML) is a branch of artificial intelligence focused on developing algorithms that learn from data to perform tasks without explicit instructions. It has numerous applications across various sectors, including social media, e-commerce, healthcare, and self-driving cars, enhancing decision-making and efficiency. The ML lifecycle consists of steps such as data gathering, preparation, analysis, model training, testing, and deployment to create effective predictive models.

Uploaded by

zarryochola
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Machine learning (ML) is a field of study in artificial intelligence

concerned with the development and study of statistical algorithms that


can learn from data and generalize to unseen data, and thus perform
tasks without explicit instructions.

Features of Machine learning

 Machine learning is data driven technology. Large amount of data


generated by organizations on daily bases. So, by notable relationships
in data, organizations makes better decisions.
 Machine can learn itself from past data and automatically improve.
 From the given dataset it detects various patterns on data.
 For the big organizations branding is important and it will become more
easy to target relatable customer base.
 It is similar to data mining because it is also deals with the huge amount
of data.

Applications of Machine Learning

Machine learning is gaining immense popularity due to the range of applications that can be used across
the world. It is now an integral and important part of both self-learning AI and robots. In the industrial
sector, machine learning is helping in the development of technologies and tools that provide faster and
cost-effective solutions to industries while also helping them predict demand and supply for their
products and pricing models.

The machine learning tutorial will cover numerous such applications impacting consumers directly with
applications such as prediction engines to online TV live streaming, which are an integral part of our
modern lifestyle. Some of the areas in which machine learning is already playing a significant role are:

1. Social Media

Social media platforms are particularly popular among the youth for their user-friendly features and the
ability to connect easily with one's contacts. It is all possible through the use of algorithms designed in
machine learning. For example, Facebook uses Machine Learning to observe and record different
activities of users and even tracks their chats, likes, and comments, and the time individuals spend on
various posts. Based on these observations and learning from the data collected, it suggests friends and
pages you should follow.

2. Product Recommendations

Being able to recommend the best and correct product is what most of the e-commerce websites aim
for. This is where Machine Learning plays an important role since product recommendations are ideal
for using machine learning techniques. Using both machine learning and AI, e-commerce websites can
track your shopping pattern based on your previous purchase, the products you searched for, and the
items in your cart. Based on these, it can make the right and best product recommendations for you.

3. Image Recognition Technology

This is a very popular application of machine learning since it helps both private and government
organizations to classify and sort images based on its particular features quickly.

4. Sentiment Analysis

Understanding the message being conveyed and the thoughts behind a particular piece of
communication are beneficial to both organizations and governments. This is where Machine Learning
plays an important role with its capability for analyzing different sentiments, to get a better
understanding of the emotion or thoughts of the speaker or the writer. In scenarios where an individual
has written a review, email, or document, the algorithm will help users understand the intention of the
text.

5. Healthcare

Good quality and preventive health care are some of the primary objectives of the healthcare sectors
and an area in which Machine Learning algorithms can play an important role.

You will also learn more about practical implementation and case studies in each section of this Machine
Learning Tutorial.

How does Machine Learning work


A machine learning system builds prediction models, learns from previous
data, and predicts the output of new data whenever it receives it. The
amount of data helps to build a better model that accurately predicts the
output, which in turn affects the accuracy of the predicted output.

Let's say we have a complex problem in which we need to make predictions.


Instead of writing code, we just need to feed the data to generic algorithms,
which build the logic based on the data and predict the output. Our
perspective on the issue has changed as a result of machine learning. The
Machine Learning algorithm's operation is depicted in the following block
diagram:
Classification of Machine Learning
At a broad level, machine learning can be classified into three types:

1. Supervised learning
2. Unsupervised learning
3. Reinforcement learning

1) Supervised Learning
In supervised learning, sample labeled data are provided to the machine
learning system for training, and the system then predicts the output based
on the training data.

The system uses labeled data to build a model that understands the datasets
and learns about each one. After the training and processing are done, we
test the model with sample data to see if it can accurately predict the
output.

The mapping of the input data to the output data is the objective of
supervised learning. The managed learning depends on oversight, and it is
equivalent to when an understudy learns things in the management of the
educator. Spam filtering is an example of supervised learning.

Supervised learning can be grouped further in two categories of algorithms:

o Classification
o Regression

2) Unsupervised Learning
Unsupervised learning is a learning method in which a machine learns
without any supervision.
The training is provided to the machine with the set of data that has not
been labeled, classified, or categorized, and the algorithm needs to act on
that data without any supervision. The goal of unsupervised learning is to
restructure the input data into new features or a group of objects with similar
patterns.

In unsupervised learning, we don't have a predetermined result. The


machine tries to find useful insights from the huge amount of data. It can be
further classifieds into two categories of algorithms:

o Clustering
o Association

3) Reinforcement Learning
Reinforcement learning is a feedback-based learning method, in which a
learning agent gets a reward for each right action and gets a penalty for
each wrong action. The agent learns automatically with these feedbacks and
improves its performance. In reinforcement learning, the agent interacts with
the environment and explores it. The goal of an agent is to get the most
reward points, and hence, it improves its performance.

The robotic dog, which automatically learns the movement of his arms, is an
example of Reinforcement learning.

Applications of Machine learning


Machine learning is a buzzword for today's technology, and it is growing very
rapidly day by day. We are using machine learning in our daily life even
without knowing it such as Google Maps, Google assistant, Alexa, etc. Below
are some most trending real-world applications of Machine Learning:
1. Image Recognition:
Image recognition is one of the most common applications of machine
learning. It is used to identify objects, persons, places, digital images, etc.
The popular use case of image recognition and face detection is, Automatic
friend tagging suggestion:

Facebook provides us a feature of auto friend tagging suggestion. Whenever


we upload a photo with our Facebook friends, then we automatically get a
tagging suggestion with name, and the technology behind this is machine
learning's face detection and recognition algorithm.

It is based on the Facebook project named "Deep Face," which is


responsible for face recognition and person identification in the picture.
2. Speech Recognition
While using Google, we get an option of "Search by voice," it comes under
speech recognition, and it's a popular application of machine learning.

Speech recognition is a process of converting voice instructions into text,


and it is also known as "Speech to text", or "Computer speech
recognition." At present, machine learning algorithms are widely used by
various applications of speech recognition. Google
assistant, Siri, Cortana, and Alexa are using speech recognition
technology to follow the voice instructions.

3. Traffic prediction:
If we want to visit a new place, we take help of Google Maps, which shows us
the correct path with the shortest route and predicts the traffic conditions.

It predicts the traffic conditions such as whether traffic is cleared, slow-


moving, or heavily congested with the help of two ways:

o Real Time location of the vehicle form Google Map app and sensors
o Average time has taken on past days at the same time.

Everyone who is using Google Map is helping this app to make it better. It
takes information from the user and sends back to its database to improve
the performance.

4. Product recommendations:
Machine learning is widely used by various e-commerce and entertainment
companies such as Amazon, Netflix, etc., for product recommendation to
the user. Whenever we search for some product on Amazon, then we started
getting an advertisement for the same product while internet surfing on the
same browser and this is because of machine learning.

Google understands the user interest using various machine learning


algorithms and suggests the product as per customer interest.

As similar, when we use Netflix, we find some recommendations for


entertainment series, movies, etc., and this is also done with the help of
machine learning.
5. Self-driving cars:
One of the most exciting applications of machine learning is self-driving cars.
Machine learning plays a significant role in self-driving cars. Tesla, the most
popular car manufacturing company is working on self-driving car. It is using
unsupervised learning method to train the car models to detect people and
objects while driving.

6. Email Spam and Malware Filtering:


Whenever we receive a new email, it is filtered automatically as important,
normal, and spam. We always receive an important mail in our inbox with
the important symbol and spam emails in our spam box, and the technology
behind this is Machine learning. Below are some spam filters used by Gmail:

o Content Filter
o Header filter
o General blacklists filter
o Rules-based filters
o Permission filters

Some machine learning algorithms such as Multi-Layer


Perceptron, Decision tree, and Naïve Bayes classifier are used for email
spam filtering and malware detection.

7. Virtual Personal Assistant:


We have various virtual personal assistants such as Google
assistant, Alexa, Cortana, Siri. As the name suggests, they help us in
finding the information using our voice instruction. These assistants can help
us in various ways just by our voice instructions such as Play music, call
someone, Open an email, Scheduling an appointment, etc.

These virtual assistants use machine learning algorithms as an important


part.

These assistant record our voice instructions, send it over the server on a
cloud, and decode it using ML algorithms and act accordingly.
8. Online Fraud Detection:
Machine learning is making our online transaction safe and secure by
detecting fraud transaction. Whenever we perform some online transaction,
there may be various ways that a fraudulent transaction can take place such
as fake accounts, fake ids, and steal money in the middle of a
transaction. So to detect this, Feed Forward Neural network helps us by
checking whether it is a genuine transaction or a fraud transaction.

For each genuine transaction, the output is converted into some hash values,
and these values become the input for the next round. For each genuine
transaction, there is a specific pattern which gets change for the fraud
transaction hence, it detects it and makes our online transactions more
secure.

9. Stock Market trading:


Machine learning is widely used in stock market trading. In the stock market,
there is always a risk of up and downs in shares, so for this machine
learning's long short term memory neural network is used for the
prediction of stock market trends.

10. Medical Diagnosis:


In medical science, machine learning is used for diseases diagnoses. With
this, medical technology is growing very fast and able to build 3D models
that can predict the exact position of lesions in the brain.

It helps in finding brain tumors and other brain-related diseases easily.

11. Automatic Language Translation:


Nowadays, if we visit a new place and we are not aware of the language then
it is not a problem at all, as for this also machine learning helps us by
converting the text into our known languages. Google's GNMT (Google
Neural Machine Translation) provide this feature, which is a Neural Machine
Learning that translates the text into our familiar language, and it called as
automatic translation.

The technology behind the automatic translation is a sequence to sequence


learning algorithm, which is used with image recognition and translates the
text from one language to another language.
Machine learning Life cycle
Machine learning has given the computer systems the abilities to
automatically learn without being explicitly programmed. But how does a
machine learning system work? So, it can be described using the life cycle of
machine learning. Machine learning life cycle is a cyclic process to build an
efficient machine learning project. The main purpose of the life cycle is to
find a solution to the problem or project.

Machine learning life cycle involves seven major steps, which are given
below:

o Gathering Data
o Data preparation
o Data Wrangling
o Analyse Data
o Train the model
o Test the model
o Deployment
The most important thing in the complete process is to understand the
problem and to know the purpose of the problem. Therefore, before starting
the life cycle, we need to understand the problem because the good result
depends on the better understanding of the problem.

In the complete life cycle process, to solve a problem, we create a machine


learning system called "model", and this model is created by providing
"training". But to train a model, we need data, hence, life cycle starts by
collecting data.

1. Gathering Data:
Data Gathering is the first step of the machine learning life cycle. The goal of
this step is to identify and obtain all data-related problems.

In this step, we need to identify the different data sources, as data can be
collected from various sources such as files, database, internet, or mobile
devices. It is one of the most important steps of the life cycle. The quantity
and quality of the collected data will determine the efficiency of the output.
The more will be the data, the more accurate will be the prediction.

This step includes the below tasks:

o Identify various data sources


o Collect data
o Integrate the data obtained from different sources

AD

By performing the above task, we get a coherent set of data, also called as
a dataset. It will be used in further steps.

2. Data preparation
After collecting the data, we need to prepare it for further steps. Data
preparation is a step where we put our data into a suitable place and prepare
it to use in our machine learning training.
In this step, first, we put all data together, and then randomize the ordering
of data.

This step can be further divided into two processes:

o Data exploration:
It is used to understand the nature of data that we have to work with. We
need to understand the characteristics, format, and quality of data.
A better understanding of data leads to an effective outcome. In this, we find
Correlations, general trends, and outliers.
o Data pre-processing:
Now the next step is preprocessing of data for its analysis.

3. Data Wrangling
Data wrangling is the process of cleaning and converting raw data into a
useable format. It is the process of cleaning the data, selecting the variable
to use, and transforming the data in a proper format to make it more
suitable for analysis in the next step. It is one of the most important steps of
the complete process. Cleaning of data is required to address the quality
issues.

It is not necessary that data we have collected is always of our use as some
of the data may not be useful. In real-world applications, collected data may
have various issues, including:

o Missing Values
o Duplicate data
o Invalid data
o Noise

So, we use various filtering techniques to clean the data.

It is mandatory to detect and remove the above issues because it can


negatively affect the quality of the outcome.

AD
4. Data Analysis
Now the cleaned and prepared data is passed on to the analysis step. This
step involves:

o Selection of analytical techniques


o Building models
o Review the result

The aim of this step is to build a machine learning model to analyze the data
using various analytical techniques and review the outcome. It starts with
the determination of the type of the problems, where we select the machine
learning techniques such as Classification, Regression, Cluster
analysis, Association, etc. then build the model using prepared data, and
evaluate the model.

Hence, in this step, we take the data and use machine learning algorithms to
build the model.

5. Train Model
Now the next step is to train the model, in this step we train our model to
improve its performance for better outcome of the problem.

We use datasets to train the model using various machine learning


algorithms. Training a model is required so that it can understand the various
patterns, rules, and, features.

6. Test Model
Once our machine learning model has been trained on a given dataset, then
we test the model. In this step, we check for the accuracy of our model by
providing a test dataset to it.

Testing the model determines the percentage accuracy of the model as per
the requirement of project or problem.

7. Deployment
The last step of machine learning life cycle is deployment, where we deploy
the model in the real-world system.
If the above-prepared model is producing an accurate result as per our
requirement with acceptable speed, then we deploy the model in the real
system. But before deploying the project, we will check whether it is
improving its performance using available data or not. The deployment
phase is similar to making the final report for a project.

Supervised Machine Learning


Supervised learning is the types of machine learning in which machines are
trained using well "labelled" training data, and on basis of that data,
machines predict the output. The labelled data means some input data is
already tagged with the correct output.

In supervised learning, the training data provided to the machines work as


the supervisor that teaches the machines to predict the output correctly. It
applies the same concept as a student learns in the supervision of the
teacher.

Supervised learning is a process of providing input data as well as correct


output data to the machine learning model. The aim of a supervised learning
algorithm is to find a mapping function to map the input variable(x)
with the output variable(y).

In the real-world, supervised learning can be used for Risk Assessment,


Image classification, Fraud Detection, spam filtering, etc.

How Supervised Learning Works?


In supervised learning, models are trained using labelled dataset, where the
model learns about each type of data. Once the training process is
completed, the model is tested on the basis of test data (a subset of the
training set), and then it predicts the output.

The working of Supervised learning can be easily understood by the below


example and diagram:
Suppose we have a dataset of different types of shapes which includes
square, rectangle, triangle, and Polygon. Now the first step is that we need to
train the model for each shape.

o If the given shape has four sides, and all the sides are equal, then it will be
labelled as a Square.
o If the given shape has three sides, then it will be labelled as a triangle.
o If the given shape has six equal sides then it will be labelled as hexagon.

Now, after training, we test our model using the test set, and the task of the
model is to identify the shape.

The machine is already trained on all types of shapes, and when it finds a
new shape, it classifies the shape on the bases of a number of sides, and
predicts the output.

Steps Involved in Supervised Learning:


o First Determine the type of training dataset
o Collect/Gather the labelled training data.
o Split the training dataset into training dataset, test dataset, and
validation dataset.
o Determine the input features of the training dataset, which should have
enough knowledge so that the model can accurately predict the output.
o Determine the suitable algorithm for the model, such as support vector
machine, decision tree, etc.
o Execute the algorithm on the training dataset. Sometimes we need validation
sets as the control parameters, which are the subset of training datasets.
o Evaluate the accuracy of the model by providing the test set. If the model
predicts the correct output, which means our model is accurate.

AD

Types of supervised Machine learning Algorithms:


Supervised learning can be further divided into two types of problems:

1. Regression

Regression algorithms are used if there is a relationship between the input


variable and the output variable. It is used for the prediction of continuous
variables, such as Weather forecasting, Market Trends, etc. Below are some
popular Regression algorithms which come under supervised learning:

o Linear Regression
o Regression Trees
o Non-Linear Regression
o Bayesian Linear Regression
o Polynomial Regression

2. Classification
Classification algorithms are used when the output variable is categorical,
which means there are two classes such as Yes-No, Male-Female, True-false,
etc.

Spam Filtering,

o Random Forest
o Decision Trees
o Logistic Regression
o Support vector Machines

Note: We will discuss these algorithms in detail in later chapters.


AD

Advantages of Supervised learning:


o With the help of supervised learning, the model can predict the output on the
basis of prior experiences.
o In supervised learning, we can have an exact idea about the classes of
objects.
o Supervised learning model helps us to solve various real-world problems such
as fraud detection, spam filtering, etc.

Disadvantages of supervised learning:


o Supervised learning models are not suitable for handling the complex tasks.
o Supervised learning cannot predict the correct output if the test data is
different from the training dataset.
o Training required lots of computation times.
o In supervised learning, we need enough knowledge about the classes of
object.

Unsupervised Machine Learning


In the previous topic, we learned supervised machine learning in which
models are trained using labeled data under the supervision of training data.
But there may be many cases in which we do not have labeled data and
need to find the hidden patterns from the given dataset. So, to solve such
types of cases in machine learning, we need unsupervised learning
techniques.

What is Unsupervised Learning?


As the name suggests, unsupervised learning is a machine learning
technique in which models are not supervised using training dataset.
Instead, models itself find the hidden patterns and insights from the given
data. It can be compared to learning which takes place in the human brain
while learning new things. It can be defined as:

Unsupervised learning is a type of machine learning in which models are trained using unlabeled
dataset and are allowed to act on that data without any supervision.

Unsupervised learning cannot be directly applied to a regression or


classification problem because unlike supervised learning, we have the input
data but no corresponding output data. The goal of unsupervised learning is
to find the underlying structure of dataset, group that data
according to similarities, and represent that dataset in a
compressed format.

Example: Suppose the unsupervised learning algorithm is given an input


dataset containing images of different types of cats and dogs. The algorithm
is never trained upon the given dataset, which means it does not have any
idea about the features of the dataset. The task of the unsupervised learning
algorithm is to identify the image features on their own. Unsupervised
learning algorithm will perform this task by clustering the image dataset into
the groups according to similarities between images.
Why use Unsupervised Learning?
Below are some main reasons which describe the importance of
Unsupervised Learning:

o Unsupervised learning is helpful for finding useful insights from the data.
o Unsupervised learning is much similar as a human learns to think by their
own experiences, which makes it closer to the real AI.
o Unsupervised learning works on unlabeled and uncategorized data which
make unsupervised learning more important.
o In real-world, we do not always have input data with the corresponding
output so to solve such cases, we need unsupervised learning.

Working of Unsupervised Learning


Working of unsupervised learning can be understood by the below diagram:

Here, we have taken an unlabeled input data, which means it is not


categorized and corresponding outputs are also not given. Now, this
unlabeled input data is fed to the machine learning model in order to train it.
Firstly, it will interpret the raw data to find the hidden patterns from the data
and then will apply suitable algorithms such as k-means clustering, Decision
tree, etc.
Once it applies the suitable algorithm, the algorithm divides the data objects
into groups according to the similarities and difference between the objects.

AD

Types of Unsupervised Learning Algorithm:


The unsupervised learning algorithm can be further categorized into two
types of problems:

o Clustering: Clustering is a method of grouping the objects into clusters such


that objects with most similarities remains into a group and has less or no
similarities with the objects of another group. Cluster analysis finds the
commonalities between the data objects and categorizes them as per the
presence and absence of those commonalities.
o Association: An association rule is an unsupervised learning method which
is used for finding the relationships between variables in the large database.
It determines the set of items that occurs together in the dataset. Association
rule makes marketing strategy more effective. Such as people who buy X
item (suppose a bread) are also tend to purchase Y (Butter/Jam) item. A
typical example of Association rule is Market Basket Analysis.

AD
Note: We will learn these algorithms in later chapters.

Unsupervised Learning algorithms:


Below is the list of some popular unsupervised learning algorithms:

o K-means clustering
o KNN (k-nearest neighbors)
o Hierarchal clustering
o Anomaly detection
o Neural Networks
o Principle Component Analysis
o Independent Component Analysis
o Apriori algorithm
o Singular value decomposition

Advantages of Unsupervised Learning


o Unsupervised learning is used for more complex tasks as compared to
supervised learning because, in unsupervised learning, we don't have labeled
input data.
o Unsupervised learning is preferable as it is easy to get unlabeled data in
comparison to labeled data.

Disadvantages of Unsupervised Learning


o Unsupervised learning is intrinsically more difficult than supervised learning
as it does not have corresponding output.
o The result of the unsupervised learning algorithm might be less accurate as
input data is not labeled, and algorithms do not know the exact output in
advance.

You might also like