0% found this document useful (0 votes)
22 views21 pages

Unit I

Uploaded by

ursdeepuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views21 pages

Unit I

Uploaded by

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

MACHINE LEARNINGUNIT - I

Machine Learning

What is the need of machine learning - Simply put, machine learning allows the

user to feed a computer algorithm an immense amount of data and have the computer

analyze and make data-driven recommendations and decisions based on only the input

data.

What is Artificial Intelligence?

Artificial intelligence, commonly referred to as AI, is the process of imparting data,


information, and human intelligence to machines. The main goal of Artificial
Intelligence is to develop self-reliant machines that can think and act like humans.
These machines can mimic human behavior and perform tasks by learning and
problem-solving. Most of the AI systems simulate natural intelligence to solve
complex problems.

Let’s have a look at an example of an AI-driven product - Amazon Echo.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

Applications of Artificial Intelligence

 Machine Translation such as Google Translate

 Self Driving Vehicles such as Google’s Waymo

 AI Robots such as Sophia and Aibo

 Speech Recognition applications like Apple’s Siri or OK Google

What is Machine Learning?

is a discipline of computer science that uses computer algorithms and analytics to


build predictive models that can solve business problems.

As per McKinsey & Co., machine learning is based on algorithms that can learn from
data without relying on rules-based programming.

Tom Mitchell’s book on machine learning says “A computer program is said to learn
from experience E with respect to some class of tasks T and performance measure P,
if its performance at tasks in T, as measured by P, improves with experience E.”

(or)

“Machine learning enables a machine to automatically learn from data, improve


performance from experiences, and predict things without being explicitly
programmed.”

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

(or)

importance of Machine Learning:

o Rapid increment in the production of data


o Solving complex problems, which are difficult for a human
o Decision making in various sector including finance
o Finding hidden patterns and extracting useful information from data

How does Machine Learning work

A Machine Learning system learns from historical data, builds the prediction
models, and whenever it receives new data, predicts the output for it. The
accuracy of predicted output depends upon the amount of data, as the huge amount of
data helps to build a better model which predicts the output more accurately.

Suppose we have a complex problem, where we need to perform some predictions, so


instead of writing a code for it, we just need to feed the data to generic algorithms,
and with the help of these algorithms, machine builds the logic as per the data and
predict the output. Machine learning has changed our way of thinking about the
problem. The below block diagram explains the working of Machine Learning
algorithm:

Features of Machine Learning:

o Machine learning uses data to detect various patterns in a given dataset.


o It can learn from past data and improve automatically.
o It is a data-driven technology.
o Machine learning is much similar to data mining as it also deals with the huge
amount of the data.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

How Does Machine Learning Work?

Machine learning accesses vast amounts of data (both structured and unstructured)
and learns from it to predict the future. It learns from the data by using multiple
algorithms and techniques. Below is a diagram that shows how a machine learns from
data.

Now that you have been introduced to the basics of machine learning and how it
works, let’s see the different types of machine learning methods.

Types of Machine Learning

Machine learning algorithms are classified into three main categories:

1. Supervised Learning

 Supervised learning is a type of machine learning method in which we


provide sample labeled data to the machine learning system in order to train
it, and on that basis, it predicts the output.

 The system creates a model using labeled data to understand the datasets
and learn about each data, once the training and processing are done then we
test the model by providing a sample data to check whether it is predicting
the exact output or not.

 The goal of supervised learning is to map input data with the output data.
The supervised learning is based on supervision, and it is the same as when a
student learns things in the supervision of the teacher. The example of
supervised learning is spam filtering.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

 Supervised learning is a process of providing input data as well as correct


output data to the machine learning model.
 The aim of a supervised learning algorithm is to find a mapping function
to map the input variable(x) with the output variable(y).

 In the real-world, supervised learning can be used for Risk Assessment,


Image classification, Fraud Detection, spam filtering, etc.

Supervised learning can be grouped further in two categories of algorithms:

I. Classification -- Classification algorithms are used when the output


variable is categorical, which means there are two classes such as Yes-No,
Male-Female, True-false, etc.

Spam Filtering,

o Random Forest
o Decision Trees
o Logistic Regression
o Support vector Machines

II.Regression -- Regression algorithms are used if there is a relationship


between the input variable and the output variable. It is used for the
prediction of continuous variables, such as Weather forecasting, Market
Trends, etc. Below are some popular Regression algorithms which come under
supervised learning:

o Linear Regression
o Regression Trees
o Non-Linear Regression
o Bayesian Linear Regression
o Polynomial Regression

Note: We will discuss these above all algorithms in detail in later chapters.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

 Below is an example of a supervised learning method. The algorithm is


trained using labeled data of dogs and cats. The trained model predicts
whether the new image is that of a cat or a dog.

Some examples of supervised learning include linear regression, logistic regression,


support vector machines, Naive Bayes, and decision tree.

(or)

Advantages of Supervised learning:

o With the help of supervised learning, the model can predict the output on
the basis of prior experiences.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

o In supervised learning, we can have an exact idea about the classes of objects.
o Supervised learning model helps us to solve various real-world problems such
as fraud detection, spam filtering, etc.

Disadvantages of supervised learning:

o Supervised learning models are not suitable for handling the complex tasks.
o Supervised learning cannot predict the correct output if the test data is
different from the training dataset.
o Training required lots of computation times.
o In supervised learning, we need enough knowledge about the classes of
object.

2. Unsupervised Learning

Unsupervised learning algorithms employ unlabeled data to discover patterns from the
data on their own. The systems are able to identify hidden features from the input data
provided. Once the data is more readable, the patterns and similarities become more
evident.

(or)

“ 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 “

Below is an example of an unsupervised learning method that trains a model using


unlabeled data. In this case, the data consists of different vehicles. The purpose of the
model is to classify each kind of vehicle.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

(or)

 Some examples of unsupervised learning include k-means clustering, hierarchical


clustering, and anomaly detection.

 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.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

 It can be further classifieds into two categories of algorithms:

o Clustering -- Clustering is a method of grouping the objects into clusters


such that objects with most similarities remains into a group and has less or
no similarities with the objects of another group. Cluster analysis finds the
commonalities between the data objects and categorizes them as per the
presence and absence of those commonalities.
o Association -- An association rule is an unsupervised learning method
which is used for finding the relationships between variables in the large
database. It determines the set of items that occurs together in the dataset.
Association rule makes marketing strategy more effective. Such as people
who buy X item (suppose a bread) are also tend to purchase Y (Butter/Jam)
item. A typical example of Association rule is Market Basket Analysis.

Note: We will learn these algorithms in later chapters.

Unsupervised Learning algorithms:

Below is the list of some popular unsupervised learning algorithms:

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

Advantages of Unsupervised Learning

o Unsupervised learning is used for more complex tasks as compared to


supervised learning because, in unsupervised learning, we don't have labeled
input data.
o Unsupervised learning is preferable as it is easy to get unlabeled data in
comparison to labeled data.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

Disadvantages of Unsupervised Learning

o Unsupervised learning is intrinsically more difficult than supervised learning


as it does not have corresponding output.
o The result of the unsupervised learning algorithm might be less accurate as
input data is not labeled, and algorithms do not know the exact output in
advance.

3. Reinforcement Learning

The goal of reinforcement learning is to train an agent to complete a task within an


uncertain environment. The agent receives observations and a reward from the
environment and sends actions to the environment. The reward measures how
successful action is with respect to completing the task goal.

Below is an example that shows how a machine is trained to identify shapes.

 Examples of reinforcement learning algorithms include Q-learning and Deep Q-


learning Neural Networks.

Machine Learning Processes

Machine Learning involves seven steps:

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

Machine Learning Applications

 Sales forecasting for different products

 Fraud analysis in banking

 Product recommendations

 Stock price prediction.

What is Deep Learning?

Deep learning is a subset of machine learning that deals with algorithms inspired by
the structure and function of the human brain. Deep learning algorithms can work
with an enormous amount of both structured and unstructured data. Deep learning’s
core concept lies in artificial neural networks, which enable machines to make
decisions.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

The major difference between deep learning vs machine learning is the way data is
presented to the machine. Machine learning algorithms usually require structured data,
whereas deep learning networks work on multiple layers of artificial neural networks.

This is what a simple neural network looks like:

The network has an input layer that accepts inputs from the data. The hidden layer is
used to find any hidden features from the data. The output layer then provides the
expected output.

Here is an example of a neural network that uses large sets of unlabeled data of eye
retinas. The network model is trained on this data to find out whether or not a person
has diabetic retinopathy.

Now that we have an idea of what deep learning is, let’s see how it works.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

How Does Deep Learning Work?

1. Calculate the weighted sums.

2. The calculated sum of weights is passed as input to the activation function.

3. The activation function takes the “weighted sum of input” as the input to the
function, adds a bias, and decides whether the neuron should be fired or not.

4. The output layer gives the predicted output.

5. The model output is compared with the actual output. After training the neural
network, the model uses the backpropagation method to improve the performance
of the network. The cost function helps to reduce the error rate.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

In the following example, deep learning and neural networks are used to identify the
number on a license plate. This technique is used by many countries to identify rules
violators and speeding vehicles.

Types of Deep Neural Networks

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

Convolutional Neural Network (CNN) - CNN is a class of deep neural networks most
commonly used for image analysis.

Recurrent Neural Network (RNN) - RNN uses sequential information to build a


model. It often works better for models that have to memorize past data.

Generative Adversarial Network (GAN) - GAN are algorithmic architectures that use
two neural networks to create new, synthetic instances of data that pass for real data.
A GAN trained on photographs can generate new photographs that look at least
superficially authentic to human observers.

Deep Belief Network (DBN) - DBN is a generative graphical model that is composed
of multiple layers of latent variables called hidden units. Each layer is interconnected,
but the units are not.

Deep Learning Applications

 Cancer tumor detection

 Captionbot for captioning an image

 Music generation

 Image coloring

 Object detection

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

How Does Machine Learning Work?

Machine learning accesses vast amounts of data (both structured and unstructured)
and learns from it to predict the future. It learns from the data by using multiple
algorithms and techniques. Below is a diagram that shows how a machine learns from
data.

Now that you have been introduced to the basics of machine learning and how it
works, let’s see the different types of machine learning methods.

Supervised Learning Unsupervised Learning

Supervised learning algorithms are trained using Unsupervised learning algorithms are trained using
L Labelled data. unlabeled data.

Supervised learning model takes direct feedback to Unsupervised learning model does not take any
check if it is predicting correct output or not. feedback.

Supervised learning model predicts the output. Unsupervised learning model finds the hidden

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

patterns in data.

In supervised learning, input data is provided to the In unsupervised learning, only input data is provided
model along with the output. to the model.

The goal of supervised learning is to train the model The goal of unsupervised learning is to find the
so that it can predict the output when it is given new hidden patterns and useful insights from the
data. unknown dataset.

Supervised learning needs supervision to train the Unsupervised learning does not need any
model. supervision to train the model.

Supervisedlearning can be categorized in UnsupervisedLearning canbe


Classification and Regression problems classified in Clustering and Associations problems.

Supervised learning can be used for those cases Unsupervised learning can be used for those cases where we
where k have know the input as well as only input data and no corresponding output data.
Corresponding outputs.

Supervised learning model produces an accurate Unsupervised learning model may give less accurate
result. result as compared to supervised learning.

S Supervised learning is not close to true Artificial Unsupervised learning is more close to the true
ntelligence as in this, we first train the model for each Artificial Intelligence as it learns similarly as a child
data, and then learns daily routine things by his experiences.
only it can predict the correct output.

t includes various algorithms such as Linear Regression, It includes various algorithms such as Clustering, KNN, and
Logistic Regression, Support Vector Machine, Multi- Apriori algorithm.
class Classification, Decision tree, Bayesian Logic, etc.

Major Challenges Faced By Machine Learning

There are a lot of challenges that machine learning professionals face to inculcate
ML skills and create an application from scratch. we will discuss seven major
challenges faced by machine learning professionals.

1. Poor Quality of Data

-> Data plays a significant role in the machine learning process. One of the
significant issues that machine learning professionals face is the absence of good
quality data.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

-> Unclean and noisy data can make the whole process extremely exhausting. We
don’t want our algorithm to make inaccurate or faulty predictions.
-> Hence the quality of data is essential to enhance the output. Therefore, we need
to ensure that the process of data preprocessing which includes removing outliers,
filtering missing values, and removing unwanted features, is done with the utmost
level of perfection.

2.Underfitting of Training Data

This process occurs when data is unable to establish an accurate relationship


between input and output variables. It simply means trying to fit in undersized
jeans. It signifies the data is too simple to establish a precise relationship. To
overcome this issue:
 Maximize the training time
 Enhance the complexity of the model
 Add more features to the data
 Reduce regular parameters
 Increasing the training time of model

3. Overfitting of Training Data

-> Overfitting refers to a machine learning model trained with a massive amount of
data that negatively affect its performance.
-> It is like trying to fit in Oversized jeans. Unfortunately, this is one of the
significant issues faced by machine learning professionals.
-> This means that the algorithm is trained with noisy and biased data, which will
affect its overall performance.
-> Let’s understand this with the help of an example. Let’s consider a model trained
to differentiate between a cat, a rabbit, a dog, and a tiger. The training data
contains 1000 cats, 1000 dogs, 1000 tigers, and 4000 Rabbits. Then there is a
considerable probability that it will identify the cat as a rabbit. In this example, we
had a vast amount of data, but it was biased; hence the prediction was negatively
affected.
We can tackle this issue by:

 Analyzing the data with the utmost level of perfection


 Use data augmentation technique
 Remove outliers in the training set
 Select a model with lesser features

4. Machine Learning is a Complex Process

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

-> The machine learning industry is young and is continuously changing. Rapid hit
and trial experiments are being carried on.
-> The process is transforming, and hence there are high chances of error which
makes the learning complex.
-> It includes analyzing the data, removing data bias, training data, applying
complex mathematical calculations, and a lot more. Hence it is a really complicated
process which is another big challenge for Machine learning professionals.

5. Lack of Training Data

-> The most important task you need to do in the machine learning process is to
train the data to achieve an accurate output. Less amount training data will
produce inaccurate or too biased predictions.
-> Let us understand this with the help of an example. Consider a machine learning
algorithm similar to training a child.
-> One day you decided to explain to a child how to distinguish between an apple
and a watermelon. You will take an apple and a watermelon and show him the
difference between both based on their color, shape, and taste.
-> In this way, soon, he will attain perfection in differentiating between the two.
But on the other hand, a machine-learning algorithm needs a lot of data to
distinguish.
-> For complex problems, it may even require millions of data to be trained.
Therefore we need to ensure that Machine learning algorithms are trained with
sufficient amounts of data.
6. Slow Implementation
-> This is one of the common issues faced by machine learning professionals. The
machine learning models are highly efficient in providing accurate results, but it
takes a tremendous amount of time.
-> Slow programs, data overload, and excessive requirements usually take a lot of
time to provide accurate results.
-> Further, it requires constant monitoring and maintenance to deliver the best
output.

7. Imperfections in the Algorithm When Data Grows

-> So you have found quality data, trained it amazingly, and the predictions are
really concise and accurate.
-> Yay, you have learned how to create a machine learning algorithm!! But wait,
there is a twist; the model may become useless in the future as data grows.
-> The best model of the present may become inaccurate in the coming Future and
require further rearrangement.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

-> So you need regular monitoring and maintenance to keep the algorithm working.
This is one of the most exhausting issues faced by machine learning professionals.

8. Monitoring and maintenance

-> As we know that generalized output data is mandatory for any machine learning
model; hence, regular monitoring and maintenance become compulsory for the
same.

-> Different results for different actions require data change; hence editing of codes
as well as resources for monitoring them also become necessary.

9. Lack of skilled resources

-> Although Machine Learning and Artificial Intelligence are continuously growing in
the market, still these industries are fresher in comparison to others.

-> The absence of skilled resources in the form of manpower is also an issue. Hence,
we need manpower having in-depth knowledge of mathematics, science, and
technologies for developing and managing scientific substances for machine learning.

10. Customer Segmentation

-> Customer segmentation is also an important issue while developing a machine


learning algorithm.

-> To identify the customers who paid for the recommendations shown by the model
and who don't even check them.

-> Hence, an algorithm is necessary to recognize the customer behavior and trigger a
relevant recommendation for the user based on past experience.

11. Data Bias

-> Data Biasing is also found a big challenge in Machine Learning. These errors exist
when certain elements of the dataset are heavily weighted or need more importance
than others.

-> Biased data leads to inaccurate results, skewed outcomes, and other analytical
errors. However, we can resolve this error by determining where data is actually
biased in the dataset. Further, take necessary steps to reduce it.

Methods to remove Data Bias:

o Research more for customer segmentation.


o Be aware of your general use cases and potential outliers.

By Murali Krishna. B VLIT Page 21


MACHINE LEARNINGUNIT - I

o Combine inputs from multiple sources to ensure data diversity.


o Include bias testing in the development process.
o Analyze data regularly and keep tracking errors to resolve them easily.
o Review the collected and annotated data.
o Use multi-pass annotation such as sentiment analysis, content moderation,
and intent recognition.

12. Lack of Explain ability

-> This basically means the outputs cannot be easily comprehended as it is


programmed in specific ways to deliver for certain conditions.

-> Hence, a lack of explain ability is also found in machine learning algorithms which
reduce the credibility of the algorithms.

By Murali Krishna. B VLIT Page 21

You might also like