Unit 1 Notes
Unit 1 Notes
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.
13.1M
212
Triggers in SQL (Hindi)
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.
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.
Google understands the user interest using various machine learning algorithms and
suggests the product as per customer interest.
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
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.
Supervised Learning :
Supervised learning is when the model is getting trained on a labelled dataset.
A labelled dataset is one that has both input and output parameters. In this type of
learning both training and validation, datasets are labelled as shown in the figures
below.
Both the above figures have labelled data set –
Figure A: It is a dataset of a shopping store that is useful in predicting
whether a customer will purchase a particular product under consideration
or not based on his/ her gender, age, and salary.
Input: Gender, Age, Salary
Output: Purchased i.e. 0 or 1; 1 means yes the customer will purchase and
0 means that the customer won’t purchase it.
Figure B: It is a Meteorological dataset that serves the purpose of
predicting wind speed based on different parameters.
Input: Dew Point, Temperature, Pressure, Relative Humidity, Wind
Direction
Output: Wind Speed
Training the system:
While training the model, data is usually split in the ratio of 80:20 i.e. 80% as training
data and rest as testing data. In training data, we feed input as well as output for 80%
of data. The model learns from training data only. We use different machine learning
algorithms(which we will discuss in detail in the next articles) to build our model. By
learning, it means that the model will build some logic of its own.
Once the model is ready then it is good to be tested. At the time of testing, the input is
fed from the remaining 20% data which the model has never seen before, the model
will predict some value and we will compare it with actual output and calculate the
accuracy.
Types of Supervised Learning:
1. Classification: It is a Supervised Learning task where output is having
defined labels(discrete value). For example in above Figure A, Output –
Purchased has defined labels i.e. 0 or 1; 1 means the customer will purchase
and 0 means that customer won’t purchase. The goal here is to predict
discrete values belonging to a particular class and evaluate them on the
basis of accuracy.
It can be either binary or multi-class classification. In binary classification,
the model predicts either 0 or 1; yes or no but in the case of multi-
class classification, the model predicts more than one class.
Example: Gmail classifies mails in more than one class like social,
promotions, updates, forums.
2. Regression: It is a Supervised Learning task where output is having
continuous value.
Example in above Figure B, Output – Wind Speed is not having any
discrete value but is continuous in the particular range. The goal here is to
predict a value as much closer to the actual output value as our model can
and then evaluation is done by calculating the error value. The smaller the
error the greater the accuracy of our regression model.
Example of Supervised Learning Algorithms:
Linear Regression
Nearest Neighbor
Gaussian Naive Bayes
Decision Trees
Support Vector Machine (SVM)
Random Forest
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.
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.
28.7M
632
C++ vs Java
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.
Once it applies the suitable algorithm, the algorithm divides the data objects into
groups according to the similarities and difference between the objects.
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
Semi-supervised Learning:
1. Value-based:
The value-based approach is about to find the optimal value function, which is the
maximum value at a state under any policy. Therefore, the agent expects the long-
term return at any state(s) under policy π.
2. Policy-based:
Policy-based approach is to find the optimal policy for the maximum future rewards
without using the value function. In this approach, the agent tries to apply such a
policy that the action performed in each step helps to maximize the future reward.
The policy-based approach has mainly two types of policy:
o Deterministic: The same action is produced by the policy (π) at any state.
o Stochastic: In this policy, probability determines the produced action.
3. Model-based: In the model-based approach, a virtual model is created for the
environment, and the agent explores that environment to learn it. There is no
particular solution or algorithm for this approach because the model representation
is different for each environment.
Train vs. Validation vs. Test set
For training and testing purposes of our model, we should have our data
broken down into three distinct dataset splits.
Descriptive Analysis:
Before using a machine learning algorithm, it is very
important to acquire abstract knowledge of the problem. The
goal of descriptive analysis is to find an accurate
understanding of the problem by asking questions from
historical data. Let’s understand the descriptive analysis
process using an example. Suppose your task is to optimize
the supply chain of a department store, for this task we
have purchase and sales data. After analyzing the data, we
make assumptions that sales increase during the day just
before the weekend. This means that our machine learning
model is based on periodicity. So, descriptive analysis helps
us understand the deep patterns from the data to uncover all
those special features that were overlooked at the initial
stage.
In short, the purpose of descriptive analysis is to enable us to
understand whether the machine learning model will perform
poorly or whether it is the best model in a particular problem.
Predictive Analysis:
Predictive analytics is an important concept in machine
learning. What happens is that once we have formed a
machine learning model based on descriptive analysis, the
next goal is to infer its future steps by giving some initial
conditions. Predictive analytics is used to discover and define
certain rules that underlie a process for pushing a particular
condition on time. For example, the object detector of a self-
driven car can be extremely precise at detecting an obstacle
in time, but another model must take action that minimizes
the risk of damage and maximizes the likelihood of safe
movement.
Predictive analytics, therefore, means observing a problem in
time and taking the most appropriate action as a prescription
to avoid any type of risk.
https://www.youtube.com/watch?v=e3Jy2vShroE