0% found this document useful (0 votes)
13 views37 pages

3rd Module (AI)

Learning is the ability of an agent to improve its behavior based on experience, encompassing methods such as memorization, direct instruction, analogy, induction, and deduction. Machine learning, a subfield of Artificial Intelligence, focuses on building systems that adapt and improve through experience, addressing challenges like knowledge acquisition in classical AI. It is applied in various fields, including data mining, recognition systems, and autonomous vehicles, and is characterized by tasks, experiences, and performance measures.

Uploaded by

singhshikha1903
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)
13 views37 pages

3rd Module (AI)

Learning is the ability of an agent to improve its behavior based on experience, encompassing methods such as memorization, direct instruction, analogy, induction, and deduction. Machine learning, a subfield of Artificial Intelligence, focuses on building systems that adapt and improve through experience, addressing challenges like knowledge acquisition in classical AI. It is applied in various fields, including data mining, recognition systems, and autonomous vehicles, and is characterized by tasks, experiences, and performance measures.

Uploaded by

singhshikha1903
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

LEARNING

Introduction to Learning
 Learning is the ability of an agent to improve its behavior based on
experience. This could mean the following:
 The range of behavior is expanded (the agent can do more).
 The accuracy on tasks is improved (the agent can do things better).
 The speed is improved (the agent can do things faster).

 Five different learning methods are as follows


1. Memorization (rote learning)
2. Direct Instruction (by being told)
3. Analogy: Analog learning is the process of learning a new concept or
solution through the use of similar known concepts or solutions. (Example
Next Slide)
4. Induction
5. Deduction
Analogy
Theory

Induction Hypothesis

Pattern

Observation

Induction Reasoning

Induction: A process of reasoning (arguing)which infers a general conclusion


based on individual cases, examples, specific bits of evidence, and other specific
types of premises.

Example: In Chicago last month, a nine-year-old boy died of an asthma attack


while waiting for emergency aid. After their ambulance was pelted by rocks in
an earlier incident, city paramedics wouldn’t risk entering the Dearborn Homes
Project (where the boy lived) without a police escort.

Thus, based on this example, one could inductively reason that the nine- year-old
boy died as a result of having to wait for emergency treatment.
Theory

Deduction

Hypothesis

Observation


Confirmation

Deduction Reasoning

Deduction: A process of reasoning that starts with a general truth, applies that truth
to a specific case (resulting in a second piece of evidence), and from those two
pieces of evidence (premises), draws a specific conclusion about the specific case.

Example: Free access to public education and health services is a key factor in the
success of industrialized nations like the United States. (major premise)
India should work hard to become a successful, industrialized nation. (specific case)

Therefore, India should provide free access to public education and health services
for its citizens. (conclusion)
Theory Theory

↓ ↑

Hypothesis Hypothesis
↓ ↑

Observation Pattern

↓ ↑
Confirmation Observation

Deduction Reasoning Induction Reasoning


Machine learning

 Machine Learning is the study of how to build computer systems that adapt
and improve with experience.

 It is a subfield of Artificial Intelligence and intersects with cognitive science,


information theory, and probability theory, among others.

 Classical AI often suffers from the knowledge acquisition problem in real life
applications where obtaining and updating the knowledge base is costly and
prone to errors.

 Machine learning serves to solve the knowledge acquisition bottleneck by


obtaining the result from data by induction.
Machine learning

Machine learning is particularly attractive in several real life problems because of


the following reasons:

 Some tasks cannot be defined well except by example


 Working environment of machines may not be known at design time
 Explicit knowledge encoding may be difficult and not available
 Environments change over time
 Biological systems learn
Recent application areas

Recently, learning is widely used in a number of application areas including:

 Data mining and knowledge discovery


 Speech/image/video (pattern) recognition
 Adaptive control
 Autonomous vehicles/robots
 Decision support systems
 Bioinformatics
 WWW
Formal Definition of Learning

Formally, 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.

Thus a learning system is characterized by:


 Task T
 Experience E, and
 Performance measure P

Examples: Learning to play chess


T: Play chess
P: Percentage of games won in world tournament
E: Opportunity to play against self or other players
Examples: Learning to drive a van

T: Drive on a public highway using vision sensors


P:Average distance traveled before an error (according to human observer)
E: Sequence of images and steering actions recorded during human driving.
The block diagram of a generic learning system which can realize the above
definition is shown above:

As can be seen from the above diagram the system consists of the following components:

 Goal: Defined with respect to the task to be performed by the system

 Model: A mathematical function which maps perception to actions

 Learning rules: Which update the model parameters with new experience such that the
performance measures with respect to the goals is optimized

 Experience: A set of perception (and possibly the corresponding actions)


Taxonomy of Learning Systems

Taxonomy of Learning Systems: Several classification of learning systems are


possible based on the above components as follows:
 Goal/Task/Target Function
 Models
 Learning Rules
 Experiences
 Supervised learning

 Unsupervised learning

 Active learning

 Reinforcement learning
Goal/Task/Target Function

Goal/Task/Target Function:
1. Prediction: To predict the desired output for a given input based on previous input/output
pairs.
E.g., to predict the value of a stock given other inputs like market index, interest rates etc.

2. Categorization: To classify an object into one of several categories based on features of


the object.
E.g., a robotic vision system to categorize a machine part into one of the categories, spanner,
hammer etc based on the parts’ dimension and shape.

3. Clustering: To organize a group of objects into homogeneous segments


e.g. a satellite image analysis system which groups land areas into forest, urban and water
body, for better utilization of natural resources.

4. Planning: To generate an optimal sequence of actions to solve a particular problem.


E.g. an Unmanned Air Vehicle which plans its path to obtain a set of pictures and avoid enemy
anti-aircraft guns.
Models

 Propositional and FOL rules


 Decision trees
 Linear separators
 Neural networks
 Graphical models
 Temporal models like hidden Markov models
Learning Rules

 Learning rules are often tied up with the model of learning used. Some common
rules are:
 Gradient descent

 Least square error

 Expectation maximization

 Margin maximization.
Experiences

 Learning algorithms use experiences in the form of perceptions or perception


action pairs to improve their performance. The nature of experiences available
varies with applications. Some common situations are described below.

1. Supervised learning: In supervised learning a teacher or oracle is available


which provides the desired action corresponding to a perception. A set of
perception action pair provides what is called a training set.
Examples include an automated vehicle where a set of vision inputs and the
corresponding steering actions are available to the learner.

2. Unsupervised learning: In unsupervised learning no teacher is available. The


learner only discovers persistent patterns in the data consisting of a collection of
perceptions. This is also called exploratory learning.
Finding out malicious network attacks from a sequence of anomalous data packets is
an example of unsupervised learning.
3. Active learning: Here not only a teacher is available, the learner has the freedom
to ask the teacher for suitable perception-action example pairs which will help the
learner to improve its performance.
Consider a news recommender system which tries to learn an users preferences and
categorize news articles as interesting or uninteresting to the user. The system may
present a particular article (of which it is not sure) to the user and ask whether it is
interesting or not.
4. Reinforcement learning: In reinforcement learning a teacher is available, but the
teacher instead of directly providing the desired action corresponding to a
perception, return reward and punishment to the learner for its action
corresponding to a perception.
(A correct answer y is not provided for each x. Rather a general evaluation is
proved after a sequence of actions (occasional rewards))
Examples include a robot in an unknown terrain where it’s get a punishment when its
hits an obstacle and reward when it moves smoothly.
Learning Automation

 The theory of learning automata was first introduced in 1961 (Tsetlin, 1961).

 Learning automata systems are finite set adaptive systems, which interact
iteratively with a general environment.

 Through a probabilistic trial-and-error response process they learn to choose or


adapt to a behavior that produces the best response. They are, essentially, a
form of weak, inductive learners.

 From Figure given below, we see that the learning model for learning automata
has been simplified for just two components, an automaton (learner) and an
environment.

 The learning cycle begins with an input to the learning automata system from
the environment.
 This input elicits one of a finite number of possible responses and then provides
some form of feedback to the automaton in return.
 The automaton to alter its stimulus-response mapping structure to improve its
behavior in a more favorable way uses this feedback.
 As a simple example, suppose a learning automata is being used to learn the
best temperature control setting for your office each morning. It may select any
one of ten temperature range settings at the beginning of each day. Without
any prior knowledge of your temperature preferences, the automaton
randomly selects a first setting using the probability vector corresponding to
the temperature settings.
Learning by Induction

 Classification is the process of assigning, to a particular input, the name of a


class to which it belongs. The classes from which the classification procedure can
be chosen, can be described in a variety of ways. Their definition will depend
on the use to which they will be put.
 Classification is an important component of many problem-solving tasks. In its
simplest form, it is presented as a straightforward recognition task.
 An example of this is the question "What letter of the alphabet is this?" But
often classification is embedded inside another operation.
 Consider a problem-solving system that contains the following production rule:
 IF: the current goal is to get from place A to place B, and there is a WALL
separating the two places
 THEN: look for a DOORWAY in the WALL and go through
 To use this rule successfully, the system's matching routine must be able to
identify an object as a wall. Without this, the rule can never be invoked.
Then, to apply the rule, the system must be able to recognize a doorway.
 This can be done by isolating a set of features that are relevant to the task
domain. Define each class by a weighted sum of values of these features.
Each class is then defined by a scoring function that looks very similar to the
scoring functions often used in other situations, such as game playing. Such a
function has the form:
 C1t1+ C2t2+ C3t3+ ...
 Regardless of the way that classes are to be described, it is often difficult to
construct, by hand, good class definitions.
 This is particularly true in domains that are not well understood or that change
rapidly.
 Thus the idea of producing a classification program that can evolve its own
class definitions is appealing.
 This task of constructing class definitions is called concept learning, or
induction.
 The techniques used for this task J must, of course, depend on the way that
classes (concepts) are described.
 If classes are described by scoring functions, then concept learning can be
done using the technique of coefficient adjustment.
24

Thank you!
Module 3

Introduction to Learning
Learning is the ability of an agent to improve its behavior based on experience. This could mean the following:
 The range of behaviors is expanded; the agent can do more.
 The accuracy on tasks is improved; the agent can do things better.
 The speed is improved; the agent can do things faster.

The five different learning methods are as follows


1. Memorization (rote learning)
2. Direct Instruction (by being told)
3. Analogy: Analog learning is the process of learning a new concept or solution through the use of similar known
concepts or solutions.
4. Induction
5. Deduction

Machine Learning is the study of how to build computer systems that adapt and improve with experience. It is a subfield
of Artificial Intelligence and intersects with cognitive science, information theory, and probability theory, among others.
Classical AI often suffers from the knowledge acquisition problem in real life applications where obtaining and updating
the knowledge base is costly and prone to errors. Machine learning serves to solve the knowledge acquisition bottleneck
by obtaining the result from data by induction.

Machine learning is particularly attractive in several real life problems because of the following reasons:
• Some tasks cannot be defined well except by example
• Working environment of machines may not be known at design time
• Explicit knowledge encoding may be difficult and not available
• Environments change over time
• Biological systems learn

Recently, learning is widely used in a number of application areas including,


• Data mining and knowledge discovery
• Speech/image/video (pattern) recognition
• Adaptive control
• Autonomous vehicles/robots
• Decision support systems
• Bioinformatics
• WWW

Formally, 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.
Thus a learning system is characterized by:
• Task T
• Experience E, and
• Performance measure P

Examples:
Learning to play chess
T: Play chess
P: Percentage of games won in world tournament
E: Opportunity to play against self or other players

Learning to drive a van


T: Drive on a public highway using vision sensors
P: Average distance traveled before an error (according to human observer)
E: Sequence of images and steering actions recorded during human driving.

The block diagram of a generic learning system which can realize the above definition is shown above:

As can be seen from the above diagram the system consists of the following components:
• Goal: Defined with respect to the task to be performed by the system
• Model: A mathematical function which maps perception to actions
• Learning rules: Which update the model parameters with new experience such that the performance measures with
respect to the goals is optimized
• Experience: A set of perception (and possibly the corresponding actions)

Taxonomy of Learning Systems


Several classification of learning systems are possible based on the above components as follows:

Goal/Task/Target Function:

1. Prediction: To predict the desired output for a given input based on previous input/output pairs. E.g., to predict the
value of a stock given other inputs like market index, interest rates etc.

2. Categorization: To classify an object into one of several categories based on features of the object. E.g., a robotic
vision system to categorize a machine part into one of the categories, spanner, hammer etc based on the parts’ dimension
and shape.

3. Clustering: To organize a group of objects into homogeneous segments e.g. a satellite image analysis system which
groups land areas into forest, urban and water body, for better utilization of natural resources.

4. Planning: To generate an optimal sequence of actions to solve a particular problem. E.g. an Unmanned Air Vehicle
which plans its path to obtain a set of pictures and avoid enemy anti-aircraft guns.

Models:
• Propositional and FOL rules
• Decision trees
• Linear separators
• Neural networks
• Graphical models
• Temporal models like hidden Markov models

Learning Rules:
Learning rules are often tied up with the model of learning used. Some common rules are gradient descent, least square
error, expectation maximization and margin maximization.
Types of Learning
A machine is said to be learning from past Experiences (data feed in) with respect to some class of Tasks, if
it’s Performance in a given Task improves with the Experience. For example, assume that a machine has to predict
whether a customer will buy a specific product let’s say “Antivirus” this year or not. The machine will do it by
looking at the previous knowledge/past experiences i.e. the data of products that the customer had bought every year
and if he buys Antivirus every year, then there is a high probability that the customer is going to bu y an antivirus this
year as well. This is how machine learning works at the basic conceptual level.

Supervised Learning:
Supervised learning is when the model is getting trained on a labelled dataset. Labelled dataset is one which 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 which 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 customer won’t
purchase it.
 Figure B: It is a Meteorological dataset which serves the purpose of predicting wind speed based on different
parameters.
Input : Dew Point, Temperature, Pressure, Relative Humidity, Wind Direction
Output : Wind Speed
For instance, suppose you are given a basket filled with different kinds of fruits. Now the first step is to train the
machine with all different fruits one by one like this:

 If shape of object is rounded and depression at top having color Red then it will be labeled as –Apple.
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% 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 on the basis of accuracy.
It can be either binary or multi class classification. In binary classification, model predicts either 0 or 1 ; yes or
no but in case of multi class classification, model predicts more than one class.
Example: Gmail classifies mails in more than one classes like social, promotions, updates, forum.
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 actual output value as our model can and
then evaluation is done by calculating error value. The smaller the error the greater the accuracy of our
regression model.

Example of Supervised Learning Algorithms:


 Linear Regression
 Nearest Neighbor
 Guassian Naive Bayes
 Decision Trees
 Support Vector Machine (SVM)
 Random Forest

Advantages:-
 Supervised learning allows collecting data and produce data output from the previous experiences.
 Helps to optimize performance criteria with the help of experience.
 Supervised machine learning helps to solve various types of real-world computation problems.
Disadvantages:-
 Classifying big data can be challenging.
 Training for supervised learning needs a lot of computation time. So, it requires a lot of time.

Unsupervised learning
Unsupervised learning is the training of machine using information that is neither classified nor labeled and allowing
the algorithm to act on that information without guidance. Here the task of machine is to group unsorted information
according to similarities, patterns and differences without any prior training of data.
Unlike supervised learning, no teacher is provided that means no training will be given to the machine. Therefore
machine is restricted to find the hidden structure in unlabeled data by our-self.
For instance, suppose it is given an image having both dogs and cats which have not seen ever.

Thus the machine has no idea about the features of dogs and cat so we can’t categorize it in dogs and cats. But it can
categorize them according to their similarities, patterns, and differences i.e., we can easily cat egorize the above
picture into two parts. First first may contain all pics having dogs in it and second part may contain all pics
having cats in it. Here you didn’t learn anything before, means no training data or examples.
It allows the model to work on its own to discover patterns and information that was previously undetected. It mainly
deals with unlabelled data.
Unsupervised learning classified into two categories of algorithms:

 Clustering: A clustering problem is where you want to discover the inherent groupings in the data, such as
grouping customers by purchasing behavior.
 Association: An association rule learning problem is where you want to discover rules that describe large
portions of your data, such as people that buy X also tend to buy Y.
Types of Unsupervised Learning:-
Clustering
1. Exclusive (partitioning)
2. Agglomerative
3. Overlapping
4. Probabilistic
Clustering Types:-
1. Hierarchical clustering
2. K-means clustering
3. Principal Component Analysis
4. Singular Value Decomposition
5. Independent Component Analysis
Supervised vs. Unsupervised Machine Learning

Supervised machine
Parameters learning Unsupervised machine learning

Algorithms are trained using Algorithms are used against data which
Input Data labeled data. is not labelled

Computational
Complexity Simpler method Computationally complex

Accuracy Highly accurate Less accurate


Semi-Supervised Learning

The basic difference between Supervised Learning and Unsupervised Learning is that Supervised Learning datasets
have an output label associated with each tuple while Unsupervised Learning datasets do not.
The most basic disadvantage of any Supervised Learning algorithm is that the dataset has to be hand-labeled either by a
Machine Learning Engineer or a Data Scientist. This is a very costly process, especially when dealing with large
volumes of data. The most basic disadvantage of any Unsupervised Learning is that its application spectrum is limited.

To counter these disadvantages, the concept of Semi-Supervised Learning was introduced. In this type of learning, the
algorithm is trained upon a combination of labeled and unlabeled data. Typically, this combination will contain a very
small amount of labeled data and a very large amount of unlabeled data. The basic procedure involved is that first, the
programmer will cluster similar data using an unsupervised learning algorithm and then use the existing labeled data to
label the rest of the unlabeled data. The typical use cases of such type of algorithm have a common property among
them – The acquisition of unlabeled data is relatively cheap while labeling the said data is very expensive.
Intuitively, one may imagine the three types of learning algorithms as Supervised learning where a student is under the
supervision of a teacher at both home and school, Unsupervised learning where a student has to figure out a concept
himself and Semi-Supervised learning where a teacher teaches a few concepts in class and gives questions as
homework which are based on similar concepts.
A Semi-Supervised algorithm assumes the following about the data –

1. Continuity Assumption: The algorithm assumes that the points which are closer to each other are more likely to
have the same output label.
2. Cluster Assumption: The data can be divided into discrete clusters and points in the same cluster are more likely
to share an output label.
3. Manifold Assumption: The data lie approximately on a manifold of much lower dimension than the input space.
This assumption allows the use of distances and densities which are defined on a manifold.

Practical applications of Semi-Supervised Learning –


1. Speech Analysis: Since labeling of audio files is a very intensive task, Semi-Supervised learning is a very natural
approach to solve this problem.
2. Internet Content Classification: Labeling each webpage is an impractical and unfeasible process and thus uses
Semi-Supervised learning algorithms. Even the Google search algorithm uses a variant of Semi-Supervised learning
to rank the relevance of a webpage for a given query.
3. Protein Sequence Classification: Since DNA strands are typically very large in size, the rise of Semi-Supervised
learning has been imminent in this field.

K-Means Clustering Algorithm


K-means clustering algorithm computes the centroids and iterates until it finds optimal centroid. It assumes that the
number of clusters is already known. It is also called flat clustering algorithm. The number of clusters identified from
data by algorithm is represented by ‘K’ in K-means.
In this algorithm, the data points are assigned to a cluster in such a manner that the sum of the squared distance between
the data points and centroid would be minimum. It is to be understood that less variation within the clusters will lead to
more similar data points within same cluster.

Working of K-Means Algorithm

We can understand the working of K-Means clustering algorithm with the help of following steps −
Step 1 − First, we need to specify the number of clusters, K, need to be generated by this algorithm.
Step 2 − Next, randomly select K data points and assign each data point to a cluster. In simple words, classify the data
based on the number of data points.
Step 3 − Now it will compute the cluster centroids.
Step 4 − Next, keep iterating the following until we find optimal centroid which is the assignment of data points to the
clusters that are not changing any more
 4.1 − First, the sum of squared distance between data points and centroids would be computed.
 4.2 − Now, we have to assign each data point to the cluster that is closer than other cluster (centroid).
 4.3 − At last compute the centroids for the clusters by taking the average of all data points of that cluster.
K-means follows Expectation-Maximization approach to solve the problem. The Expectation-step is used for assigning
the data points to the closest cluster and the Maximization-step is used for computing the centroid of each cluster.
While working with K-means algorithm we need to take care of the following things −
 While working with clustering algorithms including K-Means, it is recommended to standardize the data because
such algorithms use distance-based measurement to determine the similarity between data points.
 Due to the iterative nature of K-Means and random initialization of centroids, K-Means may stick in a local
optimum and may not converge to global optimum. That is why it is recommended to use different initializations
of centroids.
Advantages
The following are some advantages of K-Means clustering algorithms −
 It is very easy to understand and implement.
 If we have large number of variables then, K-means would be faster than Hierarchical clustering.
 On re-computation of centroids, an instance can change the cluster.
 Tighter clusters are formed with K-means as compared to Hierarchical clustering.

Disadvantages
The following are some disadvantages of K-Means clustering algorithms −
 It is a bit difficult to predict the number of clusters i.e. the value of k.
 Output is strongly impacted by initial inputs like number of clusters (value of k)
 Order of data will have strong impact on the final output.
 It is very sensitive to rescaling. If we will rescale our data by means of normalization or standardization, then the
output will completely change.
 It is not good in doing clustering job if the clusters have a complicated geometric shape.

Applications of K-Means Clustering Algorithm


The main goals of cluster analysis are −
 To get a meaningful intuition from the data we are working with.
 Cluster-then-predict where different models will be built for different subgroups.
To fulfill the above-mentioned goals, K-means clustering is performing well enough. It can be used in following
applications −
 Market segmentation
 Document Clustering
 Image segmentation
 Image compression
 Customer segmentation
 Analyzing the trend on dynamic data
Decision Tree
Decision tree is the most powerful and popular tool for classification and prediction. A Decision tree is a flowchart like
tree structure, where each internal node denotes a test on an attribute, each branch represents an outcome of the test,
and each leaf node (terminal node) holds a class label.

A decision tree for the concept PlayTennis.

Construction of Decision Tree:


A tree can be “learned” by splitting the source set into subsets based on an attribute value test. This process is repeated
on each derived subset in a recursive manner called recursive partitioning. The recursion is completed when the subset
at a node all has the same value of the target variable, or when splitting no longer adds value to the predictions. The
construction of decision tree classifier does not require any domain knowledge or parameter setting, and therefore is
appropriate for exploratory knowledge discovery. Decision trees can handle high dimensional data. In general decision
tree classifier has good accuracy. Decision tree induction is a typical inductive approach to learn knowledge on
classification.

Decision Tree Representation:


Decision trees classify instances by sorting them down the tree from the root to some leaf node, which provides the
classification of the instance. An instance is classified by starting at the root node of the tree, testing the attribute
specified by this node, then moving down the tree branch corresponding to the value of the attribute as shown in the
above figure. This process is then repeated for the sub-tree rooted at the new node.

The decision tree in above figure classifies a particular morning according to whether it is suitable for playing tennis
and returning the classification associated with the particular leaf.(in this case Yes or No).
For example, the instance
(Outlook = Rain, Temperature = Hot, Humidity = High, Wind = Strong)

would be sorted down the leftmost branch of this decision tree and would therefore be classified as a negative instance.
In other words we can say that decision tree represent a disjunction of conjunctions of constraints on the attribute
values of instances.
(Outlook = Sunny ^ Humidity = Normal) v (Outlook = Overcast) v (Outlook = Rain ^ Wind = Weak)

Strengths and Weakness of Decision Tree approach

The strengths of decision tree methods are:


 Decision trees are able to generate understandable rules.
 Decision trees perform classification without requiring much computation.
 Decision trees are able to handle both continuous and categorical variables.
 Decision trees provide a clear indication of which fields are most important for prediction or classification.

The weaknesses of decision tree methods:


 Decision trees are less appropriate for estimation tasks where the goal is to predict the value of a continuous
attribute.
 Decision trees are prone to errors in classification problems with many class and relatively small number of training
examples.
 Decision tree can be computationally expensive to train. The process of growing a decision tree is computationally
expensive. At each node, each candidate splitting field must be sorted before its best split can be found. In some
algorithms, combinations of fields are used and a search must be made for optimal combining weights. Pruning
algorithms can also be expensive since many candidate sub-trees must be formed and compared.

Neural networks
Brain has neurons or nerve cells that are the primary units of both the brain and the nerve system. These neurons receive
sensory input from the outside world which they process and then provide the output which might act as the input to the
next neuron.
Neural networks are artificial systems that were inspired by biological neural networks. These systems learn to perform
tasks by being exposed to various datasets and examples without any task-specific rules. The idea is that the system
generates identifying characteristics from the data they have been passed without being programmed with a pre-
programmed understanding of these datasets.
Artificial Neural Networks contain artificial neurons which are called units. These units are arranged in a series of layers
that together constitute the whole Artificial Neural Networks in a system. A layer can have only a dozen units or millions
of units as this depends on the complexity of the system. Commonly, Artificial Neural Network has an input layer, output
layer as well as hidden layers. The input layer receives data from the outside world which the neural network needs to
analyze or learn about. Then this data passes through one or multiple hidden layers that transform the input into data that
is valuable for the output layer. Finally, the output layer provides an output in the form of a response of the Artificial
Neural Networks to input data provided.

In the majority of neural networks, units are interconnected from one layer to another. Each of these connections has
weights that determine the influence of one unit on another unit. As the data transfers from one unit to another, the neural
network learns more and more about the data which eventually results in an output from the output layer.

How do Artificial Neural Networks learn?


Artificial neural networks are trained using a training set. For example, suppose you want to teach an ANN to
recognize a cat. Then it is shown thousands of different images of cats so that the network can learn to identify a cat.
Once the neural network has been trained enough using images of cats, then you need to check if it can identify cat
images correctly. This is done by making the ANN classify the images it is provided by deciding whether they are cat
images or not. The output obtained by the ANN is corroborated by a human-provided description of whether the image
is a cat image or not. If the ANN identifies incorrectly then back-propagation is used to adjust whatever it has learned
during training. Back-propagation is done by fine-tuning the weights of the connections in ANN units based on the
error rate obtained. This process continues until the artificial neural network can correctly recognize a cat in an image
with minimal possible error rates.

Types of Artificial Neural Networks

1. Feedforward Neural Network


The feedforward neural network is one of the most basic artificial neural networks. In this ANN, the data or the input
provided ravels in a single direction. It enters into the ANN through the input layer and exits through the output layer
while hidden layers may or may not exist. So the feedforward neural network has a front propagated wave only and
usually does not have backpropagation.
2. Recurrent Neural Network
The Recurrent Neural Network saves the output of a layer and feeds this output back to the input to better predict the
outcome of the layer. The first layer in the RNN is quite similar to the feed-forward neural network and the recurrent
neural network starts once the output of the first layer is computed. After this layer, each unit will remember some
information from the previous step so that it can act as a memory cell in performing computations.
3. Convolutional Neural Network
A Convolutional neural network has some similarities to the feed-forward neural network, where the connections
between units have weights that determine the influence of one unit on another unit. But a CNN has one or more than
one convolutional layers that use a convolution operation on the input and then pass the result obtained in the form of
output to the next layer. CNN has applications in speech and image processing which is particularly useful in computer
vision.
4. Modular Neural Network
A Modular Neural Network contains a collection of different neural networks that work independently towards
obtaining the output with no interaction between them. Each of the different neural networks performs a different sub -
task by obtaining unique inputs compared to other networks. The advantage of this modular neural network is that it
breaks down a large and complex computational process into smaller components, thus decreasing its complexity while
still obtaining the required output.
5. Radial basis function Neural Network
Radial basis functions are those functions that consider the distance of a point concerning the center. RBF functions
have two layers. In the first layer, the input is mapped into all the Radial basis functions in the hidden layer and then
the output layer computes the output in the next step. Radial basis function nets are normally used to model the data
that represents any underlying trend or function.

Applications of Artificial Neural Networks

1. Social Media
Artificial Neural Networks are used heavily in Social Media. For example, let’s take the ‘People you may
know’ feature on Facebook that suggests you people that you might know in real life so that you can send them friend
requests. Well, this magical effect is achieved by using Artificial Neural Networks that analyze your profile, your
interests, your current friends, and also their friends and various other factors to calculate the people you might
potentially know. Another common application of Machine Learning in social media is facial recognition. This is done
by finding around 100 reference points on the person’s face and then matching them with those already available in the
database using convolutional neural networks.

2. Marketing and Sales


When you log onto E-commerce sites like Amazon and Flipkart, they will recommend your products to buy based on
your previous browsing history. Similarly, suppose you love Pasta, then Zomato, Swiggy, etc. will show you restaurant
recommendations based on your tastes and previous order history. This is true across all new-age marketing segments
like Book sites, Movie services, Hospitality sites, etc. and it is done by implementing personalized marketing. This
uses Artificial Neural Networks to identify the customer likes, dislikes, previous shopping history, etc. and then tailor
the marketing campaigns accordingly.

3. Healthcare
Artificial Neural Networks are used in Oncology to train algorithms that can identify cancerous tissue at the
microscopic level at the same accuracy as trained physicians. Various rare diseases may manifest in physical
characteristics and can be identified in their premature stages by using Facial Analysis on the patient photos. So the
full-scale implementation of Artificial Neural Networks in the healthcare environment can only enhance the diagnostic
abilities of medical experts and ultimately lead to the overall improvement in the quality of medical care all over the
world.

4. Personal Assistants
I am sure you all have heard of Siri, Alexa, Cortana, etc. and also heard them based on the phones you have!!! These
are personal assistants and an example of speech recognition that uses Natural Language Processing to interact with
the users and formulate a response accordingly. Natural Language Processing uses artificial neural networks that are
made to handle many tasks of these personal assistants such as managing the language syntax, semantics, correct
speech, the conversation that is going on, etc.
Deep Learning

Deep learning is a branch of machine learning which is completely based on artificial neural networks, as neural network
is going to mimic the human brain so deep learning is also a kind of mimic of human brain. In deep learning, we don’t
need to explicitly program everything. The concept of deep learning is not new. It has been around for a couple of years
now. It’s on hype nowadays because earlier we did not have that much processing power and a lot of data. As in the last
20 years, the processing power increases exponentially, deep learning and machine learning came in the picture.
A formal definition of deep learning is- neurons

Deep learning is a particular kind of machine learning that achieves great power and flexibility by learning to represent
the world as a nested hierarchy of concepts, with each concept defined in relation to simpler concepts, and more abstract
representations computed in terms of less abstract ones.
In human brain approximately 100 billion neurons all together this is a picture of an individual neuron and each neuron is
connected through thousand of their neighbours.
The question here is how do we recreate these neurons in a computer. So, we create an artificial structure called an
artificial neural net where we have nodes or neurons. We have some neurons for input value and some for output value
and in between, there may be lots of neurons interconnected in the hidden layer.
Architectures :
1. Deep Neural Network – It is a neural network with a certain level of complexity (having multiple hidden layers in
between input and output layers). They are capable of modeling and processing non-linear relationships.
2. Deep Belief Network (DBN) – It is a class of Deep Neural Network. It is multi-layer belief networks.
Steps for performing DBN:
a. Learn a layer of features from visible units using Contrastive Divergence algorithm.
b. Treat activations of previously trained features as visible units and then learn features of features.
c. Finally, the whole DBN is trained when the learning for the final hidden layer is achieved.
3. Recurrent (perform same task for every element of a sequence) Neural Network – Allows for parallel and
sequential computation. Similar to the human brain (large feedback network of connected neurons). They are
able to remember important things about the input they received and hence enables them to be more precise.

Difference between Machine Learning and Deep Learning:


Machine Learning Deep Learning

Works on small amount of Dataset for accuracy. Works on Large amount of Dataset.

Dependent on Low-end Machine. Heavily dependent on High-end Machine.

Divides the tasks into sub-tasks, solves them individually


and finally combine the results. Solves problem end to end.

Takes less time to train. Takes longer time to train.


Machine Learning Deep Learning

Testing time may increase. Less time to test the data.

Working :
First, we need to identify the actual problem in order to get the right solution and it should be understood, the
feasibility of the Deep Learning should also be checked (whether it should fit Deep Learning or not). Second, we need
to identify the relevant data which should correspond to the actual problem and should be prepared accordingly. Third,
Choose the Deep Learning Algorithm appropriately. Fourth, Algorithm should be used while training the dataset. Fifth,
Final testing should be done on the dataset.

Tools used :
Anaconda, Jupyter, Pycharm, etc.

Languages used :
R, Python, Matlab, CPP, Java, Julia, Lisp, Java Script, etc.

Advantages:
1. Best in-class performance on problems.
2. Reduces need for feature engineering.
3. Eliminates unnecessary costs.
4. Identifies defects easily that are difficult to detect.

Disadvantages:
1. Large amount of data required.
2. Computationally expensive to train.
3. No strong theoretical foundation.

Applications:
1. Automatic Text Generation – Corpus of text is learned and from this model new text is generated, word-by-word
or character-by-character.
2. Then this model is capable of learning how to spell, punctuate, form sentences, or it may even capture the style.
3. Healthcare – Helps in diagnosing various diseases and treating it.
4. Automatic Machine Translation – Certain words, sentences or phrases in one language is transformed into another
language (Deep Learning is achieving top results in the areas of text, images).
5. Image Recognition – Recognizes and identifies peoples and objects in images as well as to understand content and
context. This area is already being used in Gaming, Retail, Tourism, etc.
6. Predicting Earthquakes – Teaches a computer to perform viscoelastic computations which are used in predicting
earthquakes.

You might also like