Unit-I Machine Leaning Notes
Unit-I Machine Leaning Notes
Examples
Handwriting recognition learning problem
o Task T : Recognizing and classifying handwritten words within images
o Performance P : Percent of words correctly classified
o Training experience E : A dataset of handwritten words with given
classifications
A robot driving learning problem
o Task T : Driving on highways using vision sensors
o Performance P : Average distance traveled before an error
o Training experience E : A sequence of images and steering commands
recorded while observing a human driver
Following are some key points which show the importance of Machine Learning:
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.
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.
Advertisement
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:
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.
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.
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.
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.
Supervised learning algorithms are trained Unsupervised learning algorithms are trained
using labeled data. using unlabeled data.
Supervised learning model predicts the output. Unsupervised learning model finds the hidden
patterns in data.
In supervised learning, input data is provided to In unsupervised learning, only input data is
the model along with the output. provided to the model.
The goal of supervised learning is to train the The goal of unsupervised learning is to find the
model so that it can predict the output when it hidden patterns and useful insights from the
is given new data. unknown dataset.
Supervised learning needs supervision to train Unsupervised learning does not need any
the model. supervision to train the model.
Supervised learning can be used for those cases Unsupervised learning can be used for those
where we know the input as well as cases where we have only input data and no
corresponding outputs. corresponding output data.
Supervised learning is not close to true Unsupervised learning is more close to the true
Artificial intelligence as in this, we first train Artificial Intelligence as it learns similarly as a
the model for each data, and then only it can child learns daily routine things by his
predict the correct output. experiences.
2. Pandas
Pandas is a popular Python library for data analysis. It is not directly related to Machine
Learning. As we know that the dataset must be prepared before training.
In this case, Pandas comes handy as it was developed specifically for data extraction and
preparation.
It provides high-level data structures and wide variety tools for data analysis. It provides
many inbuilt methods for grouping, combining and filtering data.
import pandas as pd
3. Matplotlib
Matplotlib is a very popular Python library for data visualization. Like Pandas, it is not directly
related to Machine Learning. It particularly comes in handy when a programmer wants to
visualize the patterns in the data. It is a 2D plotting library used for creating 2D graphs and
plots.
A module named pyplot makes it easy for programmers for plotting as it provides features
to control line styles, font properties, formatting axes, etc.
It provides various kinds of graphs and plots for data visualization, viz., histogram, error
charts, bar chats, etc,
4. SciPy
SciPy is a very popular library among Machine Learning enthusiasts as it contains different
modules for optimization, linear algebra, integration and statistics. There is a difference
between the SciPy library and the SciPy stack. The SciPy is one of the core packages that make
up the SciPy stack. SciPy is also very useful for image manipulation.
5. Scikit-Learn
Scikit-learn is one of the most popular ML libraries for classical ML algorithms. It is built on
top of two basic Python libraries, viz., NumPy and SciPy. Scikit-learn supports most of the
supervised and unsupervised learning algorithms. Scikit-learn can also be used for data-mining
and data-analysis, which makes it a great tool who is starting out with ML.
6. TensorFlow
TensorFlow is a very popular open-source library for high performance numerical computation
developed by the Google Brain team in Google. As the name suggests, Tensorflow is a
framework that involves defining and running computations involving tensors. It can train and
run deep neural networks that can be used to develop several AI applications. TensorFlow is
widely used in the field of deep learning research and application.
7. Keras
Keras is a very popular Python Libaries for Machine Learning . It is a high-level neural
networks API capable of running on top of TensorFlow, CNTK, or Theano. It can run
seamlessly on both CPU and GPU. Keras makes it really for ML beginners to build and design
a Neural Network. One of the best thing about Keras is that it allows for easy and fast
Difference between Machine learning and Artificial Intelligence
AI is the broader family consisting of ML and DL Machine Learning is the subset of Artificial
3.
as its components. Intelligence.
The aim is to increase the chance of success and The aim is to increase accuracy, but it does
4.
not accuracy. not care about; the success
It works as a computer program that does smart Here, the tasks systems machine takes data
6.
work. and learns from data.
AI can work with structured, semi-structured, and ML can work with only structured and
13.
unstructured data. semi-structured data.