0% found this document useful (0 votes)
13 views

NNML Notes Unit IV.docx

Uploaded by

pakhalef
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

NNML Notes Unit IV.docx

Uploaded by

pakhalef
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Subject: Neural Network and Machine learning Notes

Unit IV
Introduction: Well-posed learning problems, Designing a Learning System, Perspectives and
Issues in Machine learning, Concept Learning and General-to-specific Ordering: A concept
learning task, Concept learning as Search, Finding a maximally specific hypothesis, Version
Spaces and Candidate elimination algorithm, Inductive Bias.

Q. What is Machine Learning?


Answer:
● Machine learning is a branch of computer science that is distinct from standard
computational methods. Algorithms are sets of clearly designed instructions used by
computers to calculate or solve problems in conventional computing.
● Machine learning techniques, on the other hand, allow computers to train on data
inputs and then utilize statistical analysis to produce results that are within a certain
range.
● As a result, machine learning makes it easier for computers to create models from
sample data and automate decision-making processes based on data inputs.
● The formal definition of Machine Learning, given by Tom M. Mitchell is “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’’.

Q. Explain Well-posed learning problems.


Answer:
The formal definition of Well posed learning problem is, “A computer program is said to
learn from Experience E when given a task T, and some performance measure P. If it
performs on T with a performance measure P, then it upgrades with experience E.

To break it down, the three important components of a well-posed learning problem are,

● Task
● Performance Measure
● Experience
To understand the topic better let’s have a look at a few classical examples,
● Learning to play Checkers:
A computer might improve its performance as an ability to win at the class of tasks that are
about playing checkers. The performance keeps improving through experience by playing
against itself.
To simplify,
T -> Play the checkers game.
P -> Percentage of games won against the opponent.
E -> Playing practice games against itself.
● Handwriting Recognition:
Handwriting recognition (HWR) is a technology that converts a user’s handwritten letters or
words into a computer-readable format (e.g., Unicode text).
Its applications are numerous, it is used in reading postal addresses, bank forms, etc.
T -> recognizing and classifying handwritten words from images.
P -> Percentage of correctly identified words.
E -> set of handwritten words with their classifications in a database.

● A Robot Driving Learning Problem:


For a robot to drive on a four-lane highway it needs a human-like understanding of all the
possibilities it might encounter.

With the use of sight scanners and advanced machine learning algorithms, it can be made
possible.

T –> To drive on public four-lane highways using sight scanners.


P -> the average distance progressed before an error.
E -> the order of images and steering instructions noted down while observing a human
driver.
● A spam filtering for emails learning problem:
A spam filter is software that detects unsolicited and undesired email and prevents it from
reaching the inbox of a user.
T -> Identifying whether or not an email is spam.
P -> The percentage of emails correctly categorized as spam or nonspam.
E -> Observing how you categorize emails as spam or nonspam.
● Face Recognition Problem:
A facial recognition system device is capable of matching a human face from a digital image
or a video frame against a database of faces.
It works by locating and measuring facial characteristics from a given image and is often
used to verify users through ID verification services.
T -> Predicting distinct sorts of faces.
P -> Ability to anticipate the largest number of different sorts of faces.
E -> train the system with as many datasets of varied facial photos as possible.
.

Q. Explain Applications of Machine learning


Answer:
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.

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.

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:

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.

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 virtual assistants use machine learning algorithms as an important part.

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.

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.

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.

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.

Q. Explain the Process of Designing Learning System.


Answer:

Steps to design a learning system:


To get a successful learning system we need to have a proper design, to make the design
proper we’ll follow certain steps. In this case, designing a learning system is a five-step
process. The steps are,
1. Choosing the Training Experience
2. Choosing the Target Function
3. Choose a Representation for the Target Function
4. Choosing a Function Approximation Algorithm
5. The Final Design

1. Choosing the Training Experience


The type of training experience chosen has a considerable amount of impact on our
algorithm. The training data’s characteristics need to be similar to that of the total data set’s
characteristics.
In order to choose the right training experience for your algorithm, consider these three
attributes,
a) Type of Feedback: Check whether the training experience provides direct or indirect
feedback to the algorithm based on the choices of the performance system.
In Direct feedback, you get the feedback of your choice immediately. In the case of indirect
feedback, you get a sequence of moves and the final outcome of the sequence of action.

b) Degree: The degree of a training experience refers to the extent up to which the learner
can control the sequence of training.
For example, the learner might rely on constant feedback about the moves played or it might
itself propose a sequence of actions and only ask for help when in need.
c) The representation of the distribution of samples across which performance will be tested
is the third crucial attribute.
This basically means the more diverse the set of training experience can be the better the
performance can get.

2. Choosing the target function:


The next design decision is to figure out exactly what kind of knowledge will be acquired and
how the performance software will put it to use.
Let’s take the classic example of the checkers game to understand better. The program only
needs to learn how to select the best moves out of the legal moves(Set of all possible moves
is called legal moves).
The choice of the target function is a key feature in designing the entire system. The target
function V: B -> R. This notation denotes that V maps any legal board state from set B to a
real value.

Assigning value to target function in a checkers game,

1. V(b) = 100 if b is the final board state that is won.


2. V(b) = -100 if b is the final board state that is lost.
3. V(b) = 0 if b is the final board state that is drawn.
4. V(b) = V(b’) if b is not a final state, and b’ is the best final board state that can be achieved
starting from b and playing optimally until the end of the game.

3. Choosing Representation for Target function:

Once done with choosing the target function now we have to choose a representation of this
target function, When the machine algorithm has a complete list of all permitted movements,
it may pick the best one using any format, such as linear equations, hierarchical graph
representation, tabular form, and so on.

Out of these moves, the NextMove function will move the Target move, which will increase
the success rate. For example, if a chess machine has four alternative moves, the computer
will select the most optimal move that will lead to victory.
4. Choosing a Function Approximation Algorithm:
In this step, we choose a learning algorithm that can approximate the target function chosen.
This step further consists of two sub-steps, a. Estimating the training value, and b. Adjusting
the weights.

To estimate a training example, we consider the successor move, and in the case of adjusting
the weights, one uses certain algorithms like LMS, to find weights of linear functions.

5. The Final Design:

The final design consists of four modules, as described in the picture.


1. The performance system: The performance system solves the given performance task.
2. Critic: The critic takes the history of the game and generates training examples.
3. Generalizer: It outputs the hypothesis that is its estimate of the target function.
4. Experiment Generator: It creates a new problem after taking in the hypothesis for the
performance system to explore.

Q. Explain Issues in Machine Learning and How to solve them.


Answer :
Issues in Machine Learning and How to solve them

Machine Learning equips organizations with the information they need to make
better-informed, data-driven choices faster than they could use traditional methods.

It isn’t, however, the mythological, magical procedure that many people imagine it to be.
Machine Learning has its own set of difficulties. Here are a few frequent machine learning
issues and how to fix them.

Lack of Quality Data:

The lack of adequate data is one of the most serious problems in Machine Learning.
Algorithms often cause developers to spend the majority of their work on artificial
intelligence while updating. For the algorithms to perform as intended, data quality is critical.
The fundamental opponents of optimal ML are incomplete data, dirty data, and noisy data.

Noisy data, dirty data, and incomplete data are the quintessential enemies of ideal Machine
Learning. The solution to this conundrum is to take the time to evaluate and scope data with
meticulous data governance, data integration, and data exploration until you get clear data.
You should do this before you start.

Implementation Problems:

When companies opt to upgrade to machine learning, they frequently use examination
engines to help them. It’s a difficult task to combine newer machine learning algorithms with
old operations. Maintaining proper documentation and interpretation will go a long way
toward ensuring maximum utilization.

A few of the reasons or ways implementation problems can be caused are, lack of sufficient
data, data security issues, and slow deployment.

Change in algorithm with growth in data:

When being trained, ML algorithms will always demand a large amount of data. ML
algorithms are frequently trained on a certain data index and then used to predict future data,
a cycle that can only be expected with a large amount of work.
At a moment where the data arrangement changes, the prior “correct” model over the data set
may no longer be regarded as accurate.

Wrong assumptions are being made


Missing data points are impossible for machine learning algorithms to handle. As a result,
highlights that include a significant amount of missing data should be removed.

On the other hand, rather than removing an element with a few missing attributes, we may
fill those empty cells. The best way to cope with these challenges in Machine Learning is to
guarantee that your data is free of gaps and can express a significant amount of information.

Lack of Skilled Resources

Another difficulty with Machine Learning is that deep analytics and machine learning in their
current forms are still a relatively young technology.

Machine Learning professionals are necessary to maintain the process from the start coding
to the maintenance and monitoring. The fields of artificial intelligence and machine learning
are still relatively new to the market.

It’s also tough to find enough resources in the form of labor. As a result, there is a scarcity of
capable representatives to design and handle scientific ingredients for ML. Data scientists
frequently require a mix of spatial knowledge as well as a thorough understanding of
mathematics, technology, and science.

Identifying Which Processes Should Be Automated

In today’s world of Machine Learning, separating reality from fiction is getting increasingly
challenging. You should analyze whatever challenges you’re trying to tackle before deciding
on which AI platform to utilize.

The operations that are done manually every day with no variable output are the easiest to
automate. Before automating complicated procedures, they must be thoroughly inspected.
While Machine Learning may certainly aid in the automation of some processes, it is not
required for all automation concerns.

Segmentation of User:

Consider the data of a user’s human behavior throughout a testing period, as well as any
relevant prior habits. All things considered, an algorithm is required to distinguish between
clients who will convert to a premium version of a product and those who will not.

Based on the user’s catalog behavior, a model with this choice issue would allow the
software to generate suitable recommendations for the user.
Q. Explain the Working of Find-S Algorithm.

Answer:

The find-S algorithm is a basic concept learning algorithm in machine learning. The find-S
algorithm finds the most specific hypothesis that fits all the positive examples. We have to
note here that the algorithm considers only those positive training example. The find-S
algorithm starts with the most specific hypothesis and generalizes this hypothesis each time it
fails to classify an observed positive training data. Hence, the Find-S algorithm moves from
the most specific hypothesis to the most general hypothesis.

Important Representation:

1. ? indicates that any value is acceptable for the attribute.


2. specify a single required value ( e.g., Cold ) for the attribute.
3. Φ indicates that no value is acceptable.
4. The most general hypothesis is represented by: {?, ?, ?, ?, ?, ?}
5. The most specific hypothesis is represented by: {ϕ, ϕ, ϕ, ϕ, ϕ, ϕ}

Steps Involved In Find-S:


1. Start with the most specific hypothesis.
h = {ϕ, ϕ, ϕ, ϕ, ϕ, ϕ}
2. Take the next example and if it is negative, then no changes occur to the hypothesis.
3. If the example is positive and we find that our initial hypothesis is too specific then we
update our current hypothesis to a general condition.
4. Keep repeating the above steps till all the training examples are complete.
5. After we have completed all the training examples we will have the final hypothesis when
can use to classify the new examples.

Algorithm
1. Initialize h to the most specific hypothesis in H
2. For each positive training instance x
For each attribute constraint a, in h
If the constraint a, is satisfied by x
Then do nothing
Else replace a, in h by the next more general constraint
that is satisfied by x
3. Output hypothesis h

Example:
Consider the following data set having the data about which particular seeds are poisonous.

First, we consider the hypothesis to be a more specific hypothesis. Hence, our hypothesis
would be:
h = {ϕ, ϕ, ϕ, ϕ, ϕ, ϕ}
Consider example 1:
The data in example 1 is { GREEN, HARD, NO, WRINKLED }. We see that our initial
hypothesis is more specific and we have to generalize it for this example. Hence, the
hypothesis becomes:
h = { GREEN, HARD, NO, WRINKLED }

Consider example 2:
Here we see that this example has a negative outcome. Hence we neglect this example and
our hypothesis remains the same.
h = { GREEN, HARD, NO, WRINKLED }
Consider example 3:
Here we see that this example has a negative outcome. Hence we neglect this example and
our hypothesis remains the same.
h = { GREEN, HARD, NO, WRINKLED }

Consider example 4:
The data present in example 4 is { ORANGE, HARD, NO, WRINKLED }. We compare
every single attribute with the initial data and if any mismatch is found we replace that
particular attribute with a general case ( ” ? ” ). After doing the process the hypothesis
becomes:
h = { ?, HARD, NO, WRINKLED }

Consider example 5:
The data present in example 5 is { GREEN, SOFT, YES, SMOOTH }. We compare every
single attribute with the initial data and if any mismatch is found we replace that particular
attribute with a general case ( ” ? ” ). After doing the process the hypothesis becomes:
h = { ?, ?, ?, ? }
Since we have reached a point where all the attributes in our hypothesis have the general
condition, example 6 and example 7 would result in the same hypothesizes with all general
attributes.
h = { ?, ?, ?, ? }
Hence, for the given data the final hypothesis would be:
Final Hyposthesis: h = { ?, ?, ?, ? }

The candidate elimination algorithm incrementally builds the version space given a
hypothesis space H and a set E of examples. The examples are added one by one; each
example possibly shrinks the version space by removing the hypotheses that are inconsistent
with the example. The candidate elimination algorithm does this by updating the general and
specific boundary for each new example.

● You can consider this as an extended form of Find-S algorithm.


● Consider both positive and negative examples.
● Actually, positive examples are used here as Find-S algorithm (Basically they are
generalizing from the specification).
● While the negative example is specified from generalize form.

Terms Used:
● Concept learning: Concept learning is basically learning task of the machine (Learn by
Train data)
● General Hypothesis: Not Specifying features to learn the machine.
● G = {‘?’, ‘?’,’?’,’?’…}: Number of attributes
● Specific Hypothesis: Specifying features to learn machine (Specific feature)
● S= {‘pi’,’pi’,’pi’…}: Number of pi depends on number of attributes.
● Version Space: It is intermediate of general hypothesis and Specific hypothesis. It not
only just written one hypothesis but a set of all possible hypothesis based on training
data-set.

Algorithm:
Step1: Load Data set
Step2: Initialize General Hypothesis and Specific Hypothesis.
Step3: For each training example
Step4: If example is positive example
if attribute_value == hypothesis_value:
Do nothing
else:
replace attribute value with '?' (Basically
generalizing it)
Step5: If example is Negative example
Make generalize hypothesis more specific.

Consider the dataset given below:


Algorithmic steps:

Initially : G = [[?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?], [?, ?, ?,


?, ?, ?],
[?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?], [?, ?, ?,
?, ?, ?]]
S = [Null, Null, Null, Null, Null, Null]

For instance 1 : <'sunny','warm','normal','strong','warm ','same'>


and positive output.
G1 = G
S1 = ['sunny','warm','normal','strong','warm ','same']

For instance 2 : <'sunny','warm','high','strong','warm ','same'> and


positive output.
G2 = G
S2 = ['sunny','warm',?,'strong','warm ','same']

For instance 3 : <'rainy','cold','high','strong','warm ','change'>


and negative output.
G3 = [['sunny', ?, ?, ?, ?, ?], [?, 'warm', ?, ?, ?, ?],
[?, ?, ?, ?, ?, ?],
[?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?], [?, ?, ?,
?, ?, 'same']]
S3 = S2

For instance 4 : <'sunny','warm','high','strong','cool','change'>


and positive output.
G4 = G3
S4 = ['sunny','warm',?,'strong', ?, ?]

At last, by synchronizing the G4 and S4 algorithm produce the


output.

Output:
G = [['sunny', ?, ?, ?, ?, ?], [?, 'warm', ?, ?, ?, ?]]
S = ['sunny','warm',?,'strong', ?, ?]

You might also like