Introduction To ML
Introduction To ML
• 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
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
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
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
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.
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
1. Gathering Data:
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
• 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