TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
Machine Learning
The Machine Learning introduction covers both the fundamentals and more complex ideas of
machine learning. Students and professionals in the workforce can benefit from our machine
learning tutorial.
A rapidly developing field of technology, machine learning allows computers to automatically
learn from previous data. For building mathematical models and making predictions based on
historical data or information, machine learning employs a variety of algorithms. It is currently
being used for a variety of tasks, including speech recognition, email filtering, auto-tagging on
Facebook, a recommender system, and image recognition.
You will learn about the many different methods of machine learning, including reinforcement
learning, supervised learning, and unsupervised learning, in this machine learning tutorial.
Regression and classification models, clustering techniques, hidden Markov models, and various
sequential models will all be covered.
What is Machine Learning
In the real world, we are surrounded by humans who can learn everything from their experiences
with their learning capability, and we have computers or machines which work on our
instructions. But can a machine also learn from experiences or past data like a human does? So
here comes the role of Machine Learning.
1
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
Introduction to Machine Learning
A subset of artificial intelligence known as machine learning focuses primarily on the creation of
algorithms that enable a computer to independently learn from data and previous experiences.
Arthur Samuel first used the term "machine learning" in 1959. It could be summarized as
follows:
Without being explicitly programmed, machine learning enables a machine to automatically
learn from data, improve performance from experiences, and predict things.
Machine learning algorithms create a mathematical model that, without being explicitly
programmed, aids in making predictions or decisions with the assistance of sample historical
data, or training data. For the purpose of developing predictive models, machine learning brings
together statistics and computer science. Algorithms that learn from historical data are either
constructed or utilized in machine learning. The performance will rise in proportion to the
quantity of information we provide.
A machine can learn if it can gain more data to improve its performance.
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.
2
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
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:
Features of Machine Learning:
• Machine learning uses data to detect various patterns in a given dataset.
• It can learn from past data and improve automatically.
• It is a data-driven technology.
• Machine learning is much similar to data mining as it also deals with the huge amount of the
data.
Need for Machine Learning
The demand for machine learning is steadily rising. Because it is able to perform tasks that are
too complex for a person to directly implement, machine learning is required. Humans are
constrained by our inability to manually access vast amounts of data; as a result, we require
computer systems, which is where machine learning comes in to simplify our lives.
By providing them with a large amount of data and allowing them to automatically explore the
data, build models, and predict the required output, we can train machine learning algorithms.
The cost function can be used to determine the amount of data and the machine learning
algorithm's performance. We can save both time and money by using machine learning.
The significance of AI can be handily perceived by its utilization's cases, Presently, AI is utilized
in self-driving vehicles, digital misrepresentation identification, face acknowledgment, and
companion idea by Facebook, and so on. Different top organizations, for example, Netflix and
Amazon have constructed AI models that are utilizing an immense measure of information to
examine the client interest and suggest item likewise.
Following are some key points which show the importance of Machine Learning:
• Rapid increment in the production of data
• Solving complex problems, which are difficult for a human
• Decision making in various sector including finance
• Finding hidden patterns and extracting useful information from data.
3
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
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:
• Classification
• Regression
4
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
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:
• Clustering
• 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.
Note: We will learn about the above types of machine learning in detail in later chapters.
History of Machine Learning
Before some years (about 40-50 years), machine learning was science fiction, but today it is the
part of our daily life. Machine learning is making our day to day life easy from self-driving cars
to Amazon virtual assistant "Alexa". However, the idea behind machine learning is so old and
has a long history. Below some milestones are given which have occurred in the history of
machine learning:
5
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
The early history of Machine Learning (Pre-1940):
• 1834: In 1834, Charles Babbage, the father of the computer, conceived a device that could be
programmed with punch cards. However, the machine was never built, but all modern
computers rely on its logical structure.
• 1936: In 1936, Alan Turing gave a theory that how a machine can determine and execute a set of
instructions.
The era of stored program computers:
• 1940: In 1940, the first manually operated computer, "ENIAC" was invented, which was the first
electronic general-purpose computer. After that stored program computer such as EDSAC in
1949 and EDVAC in 1951 were invented.
• 1943: In 1943, a human neural network was modeled with an electrical circuit. In 1950, the
scientists started applying their idea to work and analyzed how human neurons might work.
Computer machinery and intelligence:
• 1950: In 1950, Alan Turing published a seminal paper, "Computer Machinery and Intelligence,"
on the topic of artificial intelligence. In his paper, he asked, "Can machines think?"
6
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
Machine intelligence in Games:
• 1952: Arthur Samuel, who was the pioneer of machine learning, created a program that helped
an IBM computer to play a checkers game. It performed better more it played.
• 1959: In 1959, the term "Machine Learning" was first coined by Arthur Samuel.
The first "AI" winter:
• The duration of 1974 to 1980 was the tough time for AI and ML researchers, and this duration
was called as AI winter.
• In this duration, failure of machine translation occurred, and people had reduced their interest
from AI, which led to reduced funding by the government to the researches.
Machine Learning from theory to reality
• 1959: In 1959, the first neural network was applied to a real-world problem to remove echoes
over phone lines using an adaptive filter.
• 1985: In 1985, Terry Sejnowski and Charles Rosenberg invented a neural network NETtalk, which
was able to teach itself how to correctly pronounce 20,000 words in one week.
• 1997: The IBM's Deep blue intelligent computer won the chess game against the chess expert
Garry Kasparov, and it became the first computer which had beaten a human chess expert.
Machine Learning at 21st century
2006:
• Geoffrey Hinton and his group presented the idea of profound getting the hang of utilizing
profound conviction organizations.
• The Elastic Compute Cloud (EC2) was launched by Amazon to provide scalable computing
resources that made it easier to create and implement machine learning models.
2007:
• Participants were tasked with increasing the accuracy of Netflix's recommendation algorithm
when the Netflix Prize competition began.
• Support learning made critical progress when a group of specialists utilized it to prepare a PC to
play backgammon at a top-notch level.
2008:
• Google delivered the Google Forecast Programming interface, a cloud-based help that permitted
designers to integrate AI into their applications.
• Confined Boltzmann Machines (RBMs), a kind of generative brain organization, acquired
consideration for their capacity to demonstrate complex information conveyances.
2009:
7
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
• Profound learning gained ground as analysts showed its viability in different errands, including
discourse acknowledgment and picture grouping.
• The expression "Large Information" acquired ubiquity, featuring the difficulties and open doors
related with taking care of huge datasets.
2010:
• The ImageNet Huge Scope Visual Acknowledgment Challenge (ILSVRC) was presented, driving
progressions in PC vision, and prompting the advancement of profound convolutional brain
organizations (CNNs).
2011:
• On Jeopardy! IBM's Watson defeated human champions., demonstrating the potential of
question-answering systems and natural language processing.
2012:
• AlexNet, a profound CNN created by Alex Krizhevsky, won the ILSVRC, fundamentally further
developing picture order precision and laying out profound advancing as a predominant
methodology in PC vision.
• Google's Cerebrum project, drove by Andrew Ng and Jeff Dignitary, utilized profound figuring out
how to prepare a brain organization to perceive felines from unlabeled YouTube recordings.
2013:
• Ian Goodfellow introduced generative adversarial networks (GANs), which made it possible to
create realistic synthetic data.
• Google later acquired the startup DeepMind Technologies, which focused on deep learning and
artificial intelligence.
2014:
• Facebook presented the DeepFace framework, which accomplished close human precision in
facial acknowledgment.
• AlphaGo, a program created by DeepMind at Google, defeated a world champion Go player and
demonstrated the potential of reinforcement learning in challenging games.
2015:
• Microsoft delivered the Mental Toolbox (previously known as CNTK), an open-source profound
learning library.
• The performance of sequence-to-sequence models in tasks like machine translation was
enhanced by the introduction of the idea of attention mechanisms.
2016:
8
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
• The goal of explainable AI, which focuses on making machine learning models easier to
understand, received some attention.
• Google's DeepMind created AlphaGo Zero, which accomplished godlike Go abilities to play
without human information, utilizing just support learning.
2017:
• Move learning acquired noticeable quality, permitting pretrained models to be utilized for
different errands with restricted information.
• Better synthesis and generation of complex data were made possible by the introduction of
generative models like variational autoencoders (VAEs) and Wasserstein GANs.
• These are only a portion of the eminent headways and achievements in AI during the predefined
period. The field kept on advancing quickly past 2017, with new leap forwards, strategies, and
applications arising.
Machine Learning at present:
The field of machine learning has made significant strides in recent years, and its applications are
numerous, including self-driving cars, Amazon Alexa, Catboats, and the recommender system. It
incorporates clustering, classification, decision tree, SVM algorithms, and reinforcement
learning, as well as unsupervised and supervised learning.
Present day AI models can be utilized for making different expectations, including climate
expectation, sickness forecast, financial exchange examination, and so on.
Prerequisites
Before learning machine learning, you must have the basic knowledge of followings so that you
can easily understand the concepts of machine learning:
• Fundamental knowledge of probability and linear algebra.
• The ability to code in any computer language, especially in Python language.
• Knowledge of Calculus, especially derivatives of single variable and multivariate functions.
Audience
Our Machine learning tutorial is designed to help beginner and professionals.
Problems
We assure you that you will not find any difficulty while learning our Machine learning tutorial.
But if there is any mistake in this tutorial, kindly post the problem or error in the contact form so
that we can improve it.
9
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE 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:
10
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
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:
• Real Time location of the vehicle form Google Map app and sensors
• 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:
11
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
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:
• Content Filter
• Header filter
• General blacklists filter
• Rules-based filters
• 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.
12
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
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:
• Gathering Data
• Data preparation
• Data Wrangling
• Analyse Data
• Train the model
• Test the model
• Deployment
13
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
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:
• Identify various data sources
• Collect data
14
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
• Integrate the data obtained from different sources
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:
• 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.
• 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:
• Missing Values
• Duplicate data
• Invalid data
• 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.
15
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
4. Data Analysis
Now the cleaned and prepared data is passed on to the analysis step. This step involves:
• Selection of analytical techniques
• Building models
• 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
ADVERTISEMENT
ADVERTISEMENT
The last step of machine learning life cycle is deployment, where we deploy the model in the
real-world system.
16
TERESA ABUYA-TOPIC 1-INTRODUCTION TO MACHINE LEARNING
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.
17