7 Machine Learning Algirithms
7 Machine Learning Algirithms
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.
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.
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.
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.
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.
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.
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.
o Content Filter
o Header filter
o General blacklists filter
o Rules-based filters
o Permission filters
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.
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.
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.
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.
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
AD
4. Data Analysis
Now the cleaned and prepared data is passed on to the analysis step. This
step involves:
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.
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.
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.
AD
1. Regression
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
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.
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.
AD
AD
Note: We will learn these algorithms in later chapters.
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