100% found this document useful (1 vote)
664 views50 pages

Introduction To ML

This document provides an introduction to machine learning, including definitions of machine learning and its applications. It discusses the main types of machine learning (supervised learning, unsupervised learning, and reinforcement learning), providing examples of each. It also covers issues in machine learning, the steps to develop a machine learning application, and common machine learning concepts like training error, generalization error, overfitting, underfitting, and the bias-variance tradeoff. Finally, it lists some key applications of machine learning like image recognition, speech recognition, traffic prediction, product recommendations, and self-driving cars.

Uploaded by

shankar patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
664 views50 pages

Introduction To ML

This document provides an introduction to machine learning, including definitions of machine learning and its applications. It discusses the main types of machine learning (supervised learning, unsupervised learning, and reinforcement learning), providing examples of each. It also covers issues in machine learning, the steps to develop a machine learning application, and common machine learning concepts like training error, generalization error, overfitting, underfitting, and the bias-variance tradeoff. Finally, it lists some key applications of machine learning like image recognition, speech recognition, traffic prediction, product recommendations, and self-driving cars.

Uploaded by

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

Introduction to Machine Learning

• Machine Learning
• Types of Machine Learning
• Issues in Machine Learning
• Application of Machine Learning
• Steps in developing a Machine Learning Application
• Training Error
• Generalization error
• Overfitting, Underfitting, BiasVariance trade-off.
Introduction to Machine Learning
Introduction to Machine Learning
Machine Learning

• Machine learning is an application of artificial intelligence (AI) that


provides systems the ability to automatically learn and improve
from experience without being explicitly programmed.
• Machine learning is turning data into information
• Machine learning focuses on the development of computer
programs that can access data and use it to learn for themselves.
• Machine Learning lies at the intersection of Comp Science, Engg and
Statistics and often appears in other disciplines
• Any field that needs to interpret and act on data that can benefit from
machine learning techniques
Machine Learning

• Machine learning is an essential branch of AI, and it finds its uses in


multiple sectors, including:
✔E-commerce
✔Healthcare
✔Social Media
✔Finance
✔Automotive
E- commerce
Healthcare
Social Media
Finance
Automotive
Machine Learning
Machine Learning

How Does Machine Learning Work?


• In machine learning, you put in some training data which trains the
computer. It uses the data for creating a model, and as it gets new
input, it uses them to make predictions. 
• If the prediction turns out to be wrong, the computer re-starts the
process again until it makes a right prediction. 
• the system learns whenever it makes a prediction
Machine Learning
• Machine learning algorithms are quite complex and require many other
steps.
• Different machine learning tools allow you to explore the depths of Data
Science domains, experiment with them, and innovate fully-functional
AI/ML solutions.
• Different tools are designed for different needs. So, the choice of Machine
Learning tools will largely depend on the project at hand, the expected
outcome, and, sometimes, your level of expertise.
Types of Machine Learning

Supervised Learning
• Supervised learning is when you provide the machine with a lot of training data to
perform a specific task. 
• For example, to teach a kid the color red, you’d show him a bunch of red things like an
apple, a red ball, right?
• After showing the kind of a bunch of red things, you’d then show him a red thing and ask
him what color it is to find out if the kid has learned it or not.
• In supervised learning, you similarly teach the machine.
• It is the most accessible type of ML to implement, and it’s also the most common one. 
• In the training data, you’d feed the machine with a lot of similar examples, and the
computer will predict the answer. You would then give feedback to the computer as to
whether it made the right prediction or not. 
Types of Machine Learning
• Example of Supervised Learning
• You give the machine with the following information:
• 2,7 = 9
• 5,6 = 11
• 9,10 = 19
• 
• Now you give the machine the following questions:
• 9,1 = ?
• 8,9 = ?
• 20,4 = ?
• 
• Depending on the machine’s answers, you’d give it more training data or give it more complex problems. 
• Supervised learning is task-specific, and that’s why it’s quite common. 
Types of Machine Learning
• Application of Supervised Learning

• Face Recognition – Recognizing faces in images (Facebook and Google Photos)

• Spam Filter – Identify spam emails by checking their content


Types of Machine Learning

Unsupervised Learning
• As the name suggests, unsupervised learning is the opposite of supervised learning.
In this case, you don’t provide the machine with any training data. 
• The machine has to reach conclusions without any labeled data. It’s a little
challenging to implement than supervised learning.
• It is used for clustering data and for finding anomalies.
• Following the example we discussed above, suppose you didn’t show the kid
different red-colored things in the beginning. 
• Instead, you put a bunch of red-colored and green-colored things in front of him
and asked him to separate them. 
• Unsupervised learning is similar to this example.
Types of Machine Learning

Example of Unsupervised Learning


• Suppose you have different news articles, and you want them sorted into
different categories. You’d give the articles to the machine, and it will
detect commonalities between them. 
• It will then divide the articles into different categories according to the
data it finds.
• Now, when you give a new article to the machine, it will categorize it
automatically. 
• Just like other machine learning types, it is also quite popular as it is
data-driven. 
Types of Machine Learning
• Application of Un-supervised Learning

• Recommendation systems – Recommend products to buyers (such as Amazon)


• Data categorization – Categorize data for better organization
• Customer segmentation – Classify customers into different categories according
to different qualities
Types of Machine Learning

Reinforcement Learning
• Reinforcement learning is quite different from other types of machine learning (supervised
and unsupervised). 
• The relation between data and machine is quite different from other machine learning types
as well. 
• In reinforcement learning, the machine learns by its mistakes. You give the machine a
specific environment in which it can perform a given set of actions. Now, it will learn by
trial and error.
• In the example we discussed above, suppose you show the kid an apple and a banana then
ask him which one is red.
• If the child answers correctly, you give him candy (or chocolate), and if the kid gives a
wrong answer, you don’t give him the same.
• In reinforcement learning, the machine learns similarly. 
Types of Machine Learning

Example of Reinforcement Learning


• You give the machine a maze to solve. The machine will attempt to
decipher the maze and make mistakes. Whenever it fails in solving the
maze, it will try again. And with each error, the machine will learn what
to avoid. 
• By repeating this activity, the machine will keep learning more
information about the maze. By using that information, it will solve the
maze in some time as well. 
• Although reinforcement learning is quite challenging to implement, it
finds applications in many industries.
Types of Machine Learning
• Application of Reinforcement Learning

• Manufacturing Industry – Streamline the automated manufacturing process 


• Robotics – Teach machines on how to avoid mistakes 
• Video Games – Better AI for video game characters and NPCs 
Introduction to Machine Learning

Issues in Machine Learning


1. What algorithms to be used for existing things
2. What method to follow to learn the training examples
3. Number of training examples and test set.
4. To reduce overhead learning which method we use.
5. According to data which method is suggestable.
Applications of Machine learning

1. Image Recognition:
• 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.
Applications of Machine learning

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.
Applications 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.
• 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.
Applications of Machine learning

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.
Applications 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.
Applications of Machine learning

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.
Applications of Machine learning

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 assistant record our voice instructions, send it over the server on a
cloud, and decode it using ML algorithms and act accordingly.
Applications of Machine learning

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.
Applications of 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.
Applications of Machine learning

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.
Applications of Machine learning

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.
Steps in developing a Machine Learning Application /Machine learning Life cycle
Machine learning Life cycle

1. Gathering Data:

• This step includes the below tasks:

• Identify various data sources


• Collect data
• Integrate the data obtained from different sources
Machine learning Life cycle

2. Data preparation

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

o Data pre-processing:
o
Now the next step is preprocessing of data for its analysis.
Machine learning Life cycle

3. Data Wrangling
• 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.
• Cleaning of data is required to address the quality issues.
• 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.
Machine learning Life cycle

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.
Machine learning Life cycle

5. Train 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.
Machine learning Life cycle

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.
Machine learning Life cycle

7. Deployment
• Here 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.
Training Error

• The training error is defined as the average loss that occurred


during the training process. It is given by:

• Here, m_t is the size of the training set and loss function is the
square of the difference between the actual output and the
predicted output. The above equation can be written as:
Training Error

• We can take the root of the above equation to calculate the


Root Mean Square Error (RMSE). It should be noted that the
train error will be low as compared to the test error.
Generalization Error

• Definition : In supervised learning applications in machine learning


and statistical learning theory, generalization error (also known as the
out-of-sample error) is a measure of how accurately an algorithm is
able to predict outcome values for previously unseen data
• Notice that the gap between predictions and observed data is
induced by model inaccuracy, sampling error, and noise.
• Some of the errors are reducible but some are not.
• Choosing the right algorithm and tuning parameters could improve
model accuracy, but we will never be able to make our predictions
100% accurate.
Overfitting, Underfitting, BiasVariance trade-off.

• Overfitting, underfitting, and the bias-variance tradeoff are


foundational concepts in machine learning.
• A model is overfit if performance on the training data, used to fit the
model, is substantially better than performance on a test set, held out
from the model training process.
• For example, the prediction error of the training data may be
noticeably smaller than that of the testing data.
• Comparing model performance metrics between these two data sets
is one of the main reasons that data are split for training and testing.
This way, the model’s capability for predictions with new, unseen data
can be assessed.
Overfitting, Underfitting, BiasVariance trade-off.

• When a model overfits the training data, it is said to have high


variance. One way to think about this is that whatever
variability exists in the training data, the model has “learned”
this very well. In fact, too well. A model with high variance is
likely to have learned the noise in the training set. Noise
consists of the random fluctuations, or offsets from true values,
in the features (independent variables) and response
(dependent variable) of the data. Noise can obscure the true
relationship between features and the response variable.
Virtually all real-world data are noisy.
Overfitting, Underfitting, BiasVariance trade-off.

• If there is random noise in the training set, then there is


probably also random noise in the testing set. However, the
specific values of the random fluctuations will be different than
those of the training set, because after all, the noise is random.
The model cannot anticipate the fluctuations in the new, unseen
data of the testing set. This why testing performance of an
overfit model is lower than training performance.
Overfitting, Underfitting, BiasVariance trade-off.

• Overfitting is more likely in the following circumstances:


• There are a large number of features available, relative to the
number of samples (observations). The more features there
are, the greater the chance of discovering a spurious
relationship between the features and the response.
• A complex model is used, such as deep decision trees, or
neural networks. Models like these effectively engineer their
own features, and have an opportunity develop more complex
hypotheses about the relationship between features and the
response, making overfitting more likely.
Overfitting, Underfitting, BiasVariance trade-off.

• At the opposite end of the spectrum, if a model is not fitting the


training data very well, this is known as underfitting, and the
model is said to have high bias. In this case, the model may
not be complex enough, in terms of the features or the type of
model being used.

You might also like