0% found this document useful (0 votes)
2 views8 pages

Unit III Bayesian Learning

Unit III discusses Bayesian learning, including basic probability notation, inference, and various Bayesian classifiers. It highlights the importance of probabilistic reasoning in AI to manage uncertainty and outlines the process of machine learning inference, detailing its components and challenges. The document emphasizes the need for collaboration between data scientists and engineers to successfully deploy and maintain machine learning models in production environments.

Uploaded by

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

Unit III Bayesian Learning

Unit III discusses Bayesian learning, including basic probability notation, inference, and various Bayesian classifiers. It highlights the importance of probabilistic reasoning in AI to manage uncertainty and outlines the process of machine learning inference, detailing its components and challenges. The document emphasizes the need for collaboration between data scientists and engineers to successfully deploy and maintain machine learning models in production environments.

Uploaded by

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

UNIT III BAYESIAN LEARNING

Basic Probability Notation- Inference – Independence - Bayes’ Rule. Bayesian Learning:


Maximum Likelihood and Least Squared error hypothesis-Maximum Likelihood
hypotheses for predicting probabilities- Minimum description Length principle -Bayes
optimal classifier - Naive Bayes classifier - Bayesian Belief networks -EM algorithm.

Basic Probability Notation


Uncertainty:
we might write A→B, which means if A is true then B is true, but consider a situation
where we are not sure about whether A is true or not then we cannot express this
statement, this situation is called uncertainty.
So to represent uncertain knowledge, where we are not sure about the predicates, we
need uncertain reasoning or probabilistic reasoning.
Causes of uncertainty:
Following are some leading causes of uncertainty to occur in the real world.
1. Information occurred from unreliable sources.
2. Experimental Errors
3. Equipment fault
4. Temperature variation
5. Climate change.
Probabilistic reasoning:
Probabilistic reasoning is a way of knowledge representation where we apply the
concept of probability to indicate the uncertainty in knowledge. In probabilistic
reasoning, we combine probability theory with logic to handle the uncertainty.
We use probability in probabilistic reasoning because it provides a way to handle the
uncertainty that is the result of someone's laziness and ignorance.
In the real world, there are lots of scenarios, where the certainty of something is not
confirmed, such as "It will rain today," "behavior of someone for some situations," "A
match between two teams or two players." These are probable sentences for which we
can assume that it will happen but not sure about it, so here we use probabilistic
reasoning.
Need of probabilistic reasoning in AI:
When there are unpredictable outcomes.
When specifications or possibilities of predicates becomes too large to handle.
When an unknown error occurs during an experiment.
In probabilistic reasoning, there are two ways to solve problems with uncertain
knowledge
Bayes' rule
Bayesian Statistics
As probabilistic reasoning uses probability and related terms, so before understanding
probabilistic reasoning, let's understand some common terms:
Probability: Probability can be defined as a chance that an uncertain event will occur.
It is the numerical measure of the likelihood that an event will occur. The value of
probability always remains between 0 and 1 that represent ideal uncertainties.
≤ P(A) ≤ 1, where P(A) is the probability of an event A.
P(A) = 0, indicates total uncertainty in an event A.
P(A) =1, indicates total certainty in an event A.
We can find the probability of an uncertain event by using the below formula.
P(¬A) = probability of a not happening event.
P(¬A) + P(A) = 1.
Event: Each possible outcome of a variable is called an event.
Sample space: The collection of all possible events is called sample space.
Random variables: Random variables are used to represent the events and objects in
the real world.
Prior probability: The prior probability of an event is probability computed before
observing new information.
Posterior Probability: The probability that is calculated after all evidence or
information has taken into account. It is a combination of prior probability and new
information.
Conditional probability:
Conditional probability is a probability of occurring an event when another event has
already happened
Let's suppose, we want to calculate the event A when event B has already occurred,
"the probability of A under the conditions of B", it can be written as:

Where P(A⋀ B)= Joint probability of a and B


P(B)= Marginal probability of B.
If the probability of A is given and we need to find the probability of B, then it will be
given as:

It can be explained by using the below Venn diagram, where B is occurred event, so
sample space will be reduced to set B, and now we can only calculate event A when

event B is already occurred by dividing the probability of .P(A⋀ B) by P( B )


Example:
In a class, there are 70% of the students who like English and 40% of the students
who likes English and mathematics, and then what is the percent of students those
who like English also like mathematics?

Solution:
Let, A is an event that a student likes Mathematics
B is an event that a student likes English.

Hence, 57% are the students who like English also like Mathematics.
Inference
Inference means to find a conclusion based on the facts, information, and
evidence. In simple words, when we conclude the facts and figures to reach a
particular decision, that is called inference. In artificial intelligence, the expert system
or any agent performs this task with the help of the inference engine. In the inference
engine, the information and facts present in the knowledge base are considered
according to the situation and the engine makes the conclusion out of these facts,
based on which the further processing and decision making takes place in the agent.
The inference process in an agent takes place according to some rules, which are
known as the inference rules or rule of inference. Following are the major types of
inference rules that are used:
Machine learning (ML) inference is the process of running live data points into a machine
learning algorithm (or “ML model”) to calculate an output such as a single numerical score. This
process is also referred to as “operationalizing an ML model” or “putting an ML model into
production.” When an ML model is running in production, it is often then described as artificial
intelligence (AI) since it is performing functions similar to human thinking and analysis.
Machine learning inference basically entails deploying a software application into a production
environment, as the ML model is typically just software code that implements a mathematical
algorithm. That algorithm makes calculations based on the characteristics of the data, known as
“features” in the ML vernacular.
An ML lifecycle can be broken up into two main, distinct parts. The first is the training phase, in
which an ML model is created or “trained” by running a specified subset of data into the model.
ML inference is the second phase, in which the model is put into action on live data to produce
actionable output. The data processing by the ML model is often referred to as “scoring,” so one
can say that the ML model scores the data, and the output is a score.
ML inference is generally deployed by DevOps engineers or data engineers. Sometimes the data
scientists, who are responsible for training the models, are asked to own the ML inference
process. This latter situation often causes significant obstacles in getting to the ML inference
stage, since data scientists are not necessarily skilled at deploying systems. Successful ML
deployments often are the result of tight coordination between different teams, and newer
software technologies are also often deployed to try to simplify the process. An emerging
discipline known as “MLOps” is starting to put more structure and resources around getting ML
models into production and maintaining those models when changes are needed.
How Does Machine Learning Inference Work?
To deploy a machine learning inference environment, you need three main components in
addition to the model:
1. One or more data sources
2. A system to host the ML model
3. One or more data destinations
In machine learning inference, the data sources are typically a system that captures
the live data from the mechanism that generates the data. The host system for the machine
learning model accepts data from the data sources and inputs the data into the machine learning
model. The data destinations are where the host system should deliver the output score from the
machine learning model.
The data sources are typically a system that captures the live data from the mechanism that
generates the data. For example, a data source might be an Apache Kafka cluster that stores data
created by an Internet of Things (IoT) device, a web application log file, or a point-of-sale (POS)
machine. Or a data source might simply be a web application that collects user clicks and sends
data to the system that hosts the ML model.
The host system for the ML model accepts data from the data sources and inputs the data into the
ML model. It is the host system that provides the infrastructure to turn the code in the ML model
into a fully operational application. After an output is generated from the ML model, the host
system then sends that output to the data destinations. The host system can be, for example, a
web application that accepts data input via a REST interface, or a stream processing application
that takes an incoming feed of data from Apache Kafka to process many data points per second.
The data destinations are where the host system should deliver the output score from the ML
model. A destination can be any type of data repository like Apache Kafka or a database, and
from there, downstream applications take further action on the scores.
For example, if the ML model calculates a fraud score on purchase data, then the applications
associated with the data destinations might send an “approve” or “decline” message back to the
purchase site.
Challenges of Machine Learning Inference
As mentioned earlier, the work in ML inference can sometimes be misallocated to the data
scientist. If given only a low-level set of tools for ML inference, the data scientist may not be
successful in the deployment.
Additionally, DevOps and data engineers are sometimes not able to help with deployment, often
due to conflicting priorities or a lack of understanding of what’s required for ML inference. In
many cases, the ML model is written in a language like Python, which is popular among data
scientists, but the IT team is more well-versed in a language like Java. This means that engineers
must take the Python code and translate it to Java to run it within their infrastructure. In addition,
the deployment of ML models requires some extra coding to map the input data into a format
that the ML model can accept, and this extra work adds to the engineers’ burden when deploying
the ML model.
Also, the ML lifecycle typically requires experimentation and periodic updates to the ML
models. If deploying the ML model is difficult in the first place, then updating models will be
almost as difficult. The whole maintenance effort can be difficult, as there are business continuity
and security issues to address.
Another challenge is attaining suitable performance for the workload. REST-based systems that
perform the ML inference often suffer from low throughput and high latency. This might be
suitable for some environments, but modern deployments that deal with IoT and online
transactions are facing huge loads that can overwhelm these simple REST-based deployments.
And the system needs to be able to scale to not only handle growing workloads but to also handle
temporary load spikes while retaining consistent responsiveness.

You might also like