Unit 3 - Decision Making Under Uncertainty in AI
Unit 3 - Decision Making Under Uncertainty in AI
3.1 Decision making under uncertainty refers to the process of making choices when
the outcomes are not fully predictable due to incomplete information, randomness, or
ambiguity. In artificial intelligence (AI), this involves making decisions in environments where
data or outcomes are uncertain, leading to challenges in predicting the best actions to take. For
example, a self-driving car deciding whether to change lanes in heavy traffic is making
decisions under uncertainty because it cannot perfectly predict the actions of nearby drivers.
Incomplete information: When the AI system doesn’t have access to all the data
needed to make a fully informed decision.
Stochastic (random) environments: Where outcomes are probabilistic and have
inherent randomness.
Dynamic environments: Where the state of the environment changes rapidly, and the
system can only partially observe it.
To make effective decisions in the face of uncertainty, AI systems use various techniques to
model, assess, and mitigate the risks associated with uncertain situations. Some common
methods include:
1
Authored By: Dr. Anup Girdhar
Example: A medical diagnostic system may use Bayesian inference to update the probability
of a disease based on new test results.
MDPs are useful for long-term planning in uncertain environments and are often solved using
Dynamic Programming or Reinforcement Learning techniques.
Example: A robot navigating a factory floor can use an MDP to determine the optimal path
while accounting for uncertainty in movement.
Utility Theory: Utility theory is used to model preferences over different outcomes.
Utility values represent the satisfaction or value associated with each outcome, and the
goal is to maximize the expected utility.
Expected Utility: This is the sum of the utilities of all possible outcomes, each
weighted by its probability of occurrence. By maximizing expected utility, AI systems
can make rational decisions even when outcomes are uncertain.
2
Authored By: Dr. Anup Girdhar
4. Decision Trees and Influence Diagrams
Example: A marketing AI system might use a decision tree to decide whether to launch a new
product, based on uncertain factors like market demand and competitor actions.
6. Fuzzy Logic
3
Authored By: Dr. Anup Girdhar
Membership Functions: Fuzzy logic uses membership functions to represent the
degree to which an element belongs to a set, allowing AI systems to make decisions
based on partial truths.
Example: In temperature control systems, fuzzy logic allows a system to interpret input values
(like "slightly warm" or "very cold") and adjust the output accordingly, even under uncertain
conditions.
Here is an example using Bayesian Inference in Python to make a decision under uncertainty.
Suppose a diagnostic system is trying to determine the probability of a disease given a positive
test result.
4
Authored By: Dr. Anup Girdhar
#python
# Bayesian Inference example
# Given probabilities
P_disease = 0.01 # Prior probability of having the disease
P_positive_given_disease = 0.99 # Probability of a positive test if disease is present
P_positive_given_no_disease = 0.05 # Probability of a positive test if disease is absent
# Calculate P(Positive)
P_no_disease = 1 - P_disease
P_positive = P_positive_given_disease * P_disease + P_positive_given_no_disease * P_no_disease
Output:
#plaintext
Probability of having the disease given a positive test result: 16.67%
This result shows that even with a positive test result, the probability of actually having the
disease is only 16.67% due to the relatively low prior probability and test imperfections.
5
Authored By: Dr. Anup Girdhar
What is Learning by Induction?
Inductive learning involves creating hypotheses or models based on specific training examples
and then using those models to make decisions about new data. It contrasts with deductive
reasoning, where the system starts with general rules and applies them to specific cases.
1. Collect Training Data: Gather observations or examples from the environment. These
can include labeled examples where the outcomes or decisions are known.
2. Model Creation: Use machine learning algorithms (e.g., decision trees, support vector
machines, neural networks) to build a model that generalizes from the training data.
3. Pattern Recognition: Identify patterns, correlations, and relationships in the data to
form decision rules or predictive models.
4. Hypothesis Testing: Validate the learned model on unseen data to ensure it generalizes
well.
5. Decision Making: Apply the learned model to make predictions and decisions when
faced with uncertainty in new situations.
Several machine learning algorithms can be used for inductive learning and decision-making
under uncertainty:
1. Decision Trees
How They Work: Decision trees split the data into branches based on feature values,
creating paths that lead to a decision (leaf node). The tree is trained using historical data
to identify which features and thresholds best split the data for accurate decision-
making.
6
Authored By: Dr. Anup Girdhar
Example Use: A medical diagnosis system might use a decision tree to decide whether
a patient has a particular disease based on symptoms.
Pros and Cons:
o Pros: Easy to interpret, handle both categorical and numerical data.
o Cons: Can overfit the training data, leading to poor generalization.
2. Random Forests
How They Work: Random forests combine multiple decision trees, each trained on
different subsets of data, to make more robust and accurate predictions. The final
decision is based on the majority vote or average prediction from all trees.
Example Use: Financial decision-making, where an AI needs to assess the risk of
approving a loan under uncertain conditions.
Pros and Cons:
o Pros: Reduces overfitting, robust against noisy data.
o Cons: Less interpretable than a single decision tree.
3. Bayesian Networks
How They Work: Bayesian networks represent a set of variables and their conditional
dependencies using a directed acyclic graph (DAG). They use Bayes' theorem to update
beliefs based on new evidence, making them well-suited for decision-making under
uncertainty.
Example Use: A fault diagnosis system in engineering that determines the likelihood
of a machine failure given certain observed symptoms.
Pros and Cons:
o Pros: Can handle uncertainty effectively, can be updated dynamically with new
data.
o Cons: Requires knowledge of conditional probabilities and structure.
How They Work: SVMs classify data by finding the hyperplane that best separates
classes in a high-dimensional space. This is useful when making binary decisions under
uncertainty.
7
Authored By: Dr. Anup Girdhar
Example Use: Spam detection systems that classify emails as spam or not based on the
content.
Pros and Cons:
o Pros: Effective in high-dimensional spaces, works well with small datasets.
o Cons: Not ideal for larger datasets, can be sensitive to the choice of kernel.
5. Neural Networks
How They Work: Neural networks consist of interconnected layers of nodes that
process data and learn complex patterns through backpropagation. They are highly
effective for decision-making in uncertain environments, especially when trained on
large datasets.
Example Use: Predicting stock prices based on historical trends and external factors.
Pros and Cons:
o Pros: Can model complex and nonlinear relationships, highly accurate for large
datasets.
o Cons: Requires significant computational resources, can be a "black box" with
less interpretability.
Inductive learning models can handle uncertainty by incorporating probability distributions and
learning from data that includes varying levels of reliability. Here are some techniques:
8
Authored By: Dr. Anup Girdhar
4. Cross-Validation: Cross-validation helps to evaluate how the model performs on
different subsets of the data, providing an estimate of its reliability and performance
under uncertainty.
Example Python Code for Decision Making Using Inductive Learning (Decision Tree)
from sklearn import tree
X = [[1, 1], [1, 0], [0, 1], [0, 0], [1, 1], [0, 0]]
y = [1, 0, 0, 0, 1, 0]
clf = tree.DecisionTreeClassifier()
# Make predictions
y_pred = clf.predict(X_test)
# Calculate accuracy
9
Authored By: Dr. Anup Girdhar
# Visualize the decision tree (optional, requires graphviz)
tree.plot_tree(clf)
Training a Decision Tree: The code trains a decision tree classifier using a small
dataset of symptoms and corresponding outcomes (diseases).
Evaluating the Model: It splits the data into training and testing sets and calculates the
accuracy on the test data.
Decision Tree Visualization: tree.plot_tree() visualizes the decision tree structure,
making it easier to interpret the learned decision rules.
Neural networks and genetic algorithms (GAs) are two powerful techniques in artificial
intelligence that can be combined to solve complex optimization and learning problems.
Understanding the basics of how these two methods work individually and in combination is
essential for leveraging their potential in real-world applications.
Neural networks are a subset of machine learning models inspired by the structure and
function of the human brain. They consist of interconnected nodes (or neurons) organized into
layers:
Training a neural network involves finding the optimal weights for connections between
neurons to minimize a loss function, which represents the error between predicted and actual
outputs. This is typically done using gradient descent and backpropagation.
10
Authored By: Dr. Anup Girdhar
2. Basics of Genetic Algorithms
Genetic algorithms (GAs) are search heuristics inspired by the process of natural selection.
They are used for optimization problems where the solution space is vast, and traditional
optimization methods might not be effective.
11
Authored By: Dr. Anup Girdhar
3. Combining Neural Networks with Genetic Algorithms
Neural networks and genetic algorithms can be combined in various ways to take advantage of
the strengths of both approaches. Here are some common use cases:
Hyperparameters like learning rate, number of hidden layers, number of neurons, and
activation functions can significantly impact a neural network's performance. Instead of using
traditional grid search or manual tuning, GAs can be used to optimize these hyperparameters.
Process:
2. Fitness Function: Train the neural network with the given hyperparameters and
evaluate its performance (e.g., using accuracy or loss on a validation set).
3. GA Process: Use the standard GA workflow (selection, crossover, mutation) to evolve
better sets of hyperparameters over generations.
GAs can also be used to optimize the weights of a neural network, either alone or in
combination with backpropagation. This approach can be useful when:
Process:
12
Authored By: Dr. Anup Girdhar
3.3 Evolutionary Neural Architecture Search
Neural Architecture Search (NAS) is the automated process of designing neural network
architectures. GAs can be used to evolve architectures by representing different neural network
configurations as chromosomes.
Example:
Each chromosome can represent different architectural decisions, such as the number
of layers, types of layers (e.g., convolutional or fully connected), and connections
between them.
The GA evolves architectures by selecting, recombining, and mutating them, searching
for the best-performing architecture according to a fitness function (e.g., accuracy on a
validation set).
Avoids Local Minima: GAs can explore a broader search space and are less likely to
get stuck in local minima compared to gradient-based methods.
Non-Differentiable Optimization: GAs can be used for optimizing functions that are
non-differentiable or complex.
Parallelism: GAs can evaluate multiple solutions simultaneously, making them
suitable for parallel computing environments.
Disadvantages
13
Authored By: Dr. Anup Girdhar
Basic Python Example of Genetic Algorithm for Neural Network Hyperparameter
Tuning
#python
import random
# Load dataset
data = load_iris()
def fitness_function(params):
model.fit(X_train, y_train)
predictions = model.predict(X_test)
population_size = 10
generations = 5
mutation_rate = 0.1
14
Authored By: Dr. Anup Girdhar
# Initialize population
# Evolution process
# Evaluate fitness
offspring = []
offspring.append(child)
15
Authored By: Dr. Anup Girdhar
child = (child[0] * random.uniform(0.9, 1.1), max(5, min(100, child[1] + random.randint(-5,
5))))
# Best individual
Explanation:
Rough Set Theory (RST) is a mathematical approach to dealing with uncertainty and
vagueness in data analysis. It was introduced by Zdzisław Pawlak in the early 1980s and
provides a framework for reasoning about data without requiring additional information, such
as probabilities or fuzzy memberships. Rough sets are particularly useful in situations where it
is challenging to define sharp boundaries between different sets due to incomplete or imprecise
information.
16
Authored By: Dr. Anup Girdhar
Basic Concepts of Rough Sets
1. Information System:
o An information system (or data table) is a collection of objects (rows)
described by attributes (columns). Each object is characterized by values for
each attribute.
o Formally, an information system IS=(U,A), where U is the universe of objects,
and A is a set of attributes.
17
Authored By: Dr. Anup Girdhar
Applications of Rough Set Theory
Data mining and knowledge discovery: Identifying hidden patterns and extracting
rules from datasets.
Feature selection: Reducing the number of attributes needed for analysis while
preserving important information.
Decision support systems: Supporting decisions by analyzing uncertain or incomplete
data.
Classification and pattern recognition: Building models that can handle vague or
imprecise data.
Handling Real-valued Attributes: RST is best suited for categorical data, and
handling continuous attributes requires discretization.
Computational Complexity: Calculating the lower and upper approximations for large
datasets can be computationally intensive.
Dependency on Data Quality: Like other data-driven techniques, the quality of
analysis depends on the completeness and accuracy of the data.
18
Authored By: Dr. Anup Girdhar
Object Attribute 1 Attribute 2 Decision
1 A X Yes
2 A Y No
3 B X Yes
4 B Y No
5 A X Yes
import pandas as pd
# Sample data
data = {
19
Authored By: Dr. Anup Girdhar
df = pd.DataFrame(data)
groups = df.groupby(attributes).groups
lower_approx = set()
upper_approx = set()
if set(group).issubset(positive_region):
lower_approx.update(group)
if set(group).intersection(positive_region):
upper_approx.update(group)
20
Authored By: Dr. Anup Girdhar
return lower_approx, upper_approx
Output Example:
This output indicates that objects 0, 2, and 4 are definitely in the "Yes" decision set, while
object 3 lies in the boundary region and cannot be classified definitively.
21
Authored By: Dr. Anup Girdhar
3.7 Case Studies of Applications of Uncertainty in AI
Challenge: Medical data often come with uncertainties due to variability in test results,
incomplete patient histories, and subjective observations. Making accurate diagnoses under
these conditions is difficult.
Approach:
Outcome: The use of Bayesian networks improved the system's ability to handle uncertainty,
making it reliable for supporting decision-making in clinical environments.
Challenge: Autonomous vehicles must make real-time decisions in environments filled with
uncertainty due to unpredictable human behavior, sensor noise, and varying weather
conditions.
Approach:
22
Authored By: Dr. Anup Girdhar
Markov Decision Processes (MDPs): MDPs were used to model the decision-making process
under uncertainty. The vehicle's AI system evaluated the probability of different outcomes
when deciding actions like lane changes or braking.
Sensor Fusion: Multiple sensors (e.g., LiDAR, radar, cameras) provided overlapping data to
mitigate individual sensor inaccuracies. A probabilistic model combined this data to create a
more reliable perception of the environment.
Reinforcement Learning (RL): The system was trained using RL algorithms that rewarded
safe navigation and penalized risky behaviors. The AI learned to adapt and make optimal
decisions despite uncertain factors like unexpected pedestrian movement.
Outcome: These techniques significantly reduced the vehicle's error rate and improved its
response to uncertain situations, ensuring safer navigation and better adherence to traffic rules.
Challenge: The stock market is highly uncertain, influenced by myriad factors including
economic indicators, political events, and investor sentiment. Predicting price movements and
identifying profitable trading opportunities require managing this uncertainty.
Approach:
Machine Learning Models: Neural networks and decision trees were trained on historical
price data, company performance metrics, and economic indicators to identify patterns and
predict price movements.
Monte Carlo Simulation: Used to model and simulate different potential future market
scenarios, accounting for variability in asset returns and volatility.
Portfolio Optimization: Techniques like stochastic optimization were employed to construct
diversified portfolios that could maximize returns while minimizing risk under uncertainty.
Outcome: By integrating machine learning models with simulation techniques, the AI system
improved the prediction of stock price movements and optimized trading strategies, resulting
in better financial performance and reduced risk exposure.
23
Authored By: Dr. Anup Girdhar
Case Study 4: Weather Forecasting and Climate Modeling
Application: AI systems for short-term weather forecasting and long-term climate modeling.
Challenge: Weather forecasting involves inherent uncertainties due to the chaotic nature of the
atmosphere and limitations in observing and simulating weather patterns.
Approach:
Probabilistic Forecasting: Ensemble models were used to generate multiple weather forecast
simulations. Each simulation varied slightly in initial conditions to represent different potential
outcomes.
Neural Networks with Uncertainty Estimation: Advanced deep learning models like
Bayesian neural networks incorporated uncertainty estimation in their predictions, providing
not only the most likely weather outcome but also a confidence interval for each forecast.
Data Assimilation: Combined data from various sources (e.g., satellite, radar, and ground
stations) using statistical techniques that accounted for measurement errors and data gaps.
Outcome: The integration of probabilistic models and data assimilation significantly enhanced
the accuracy and reliability of weather forecasts. Users received not just a single deterministic
forecast but a range of potential weather outcomes with associated probabilities.
Application: AI-based systems for managing supply chains and inventory in the retail and
manufacturing industries.
Challenge: Supply chain management involves multiple uncertain factors, such as fluctuations
in demand, supplier delays, and transportation issues. Making precise decisions to maintain
optimal inventory levels and ensure timely deliveries is complex under these conditions.
Approach:
24
Authored By: Dr. Anup Girdhar
Fuzzy Logic: Incorporated in some systems to handle linguistic uncertainty (e.g., "high
demand" or "short delay"), allowing for more flexible decision-making.
Outcome: These AI techniques helped companies better predict demand, plan logistics, and
maintain optimal inventory levels. The result was a reduction in operational costs and improved
customer satisfaction due to fewer supply chain disruptions.
Application: AI systems for analyzing customer feedback and sentiment on social media or
review platforms.
Challenge: Customer feedback often contains unstructured and subjective data, making it
difficult to derive precise conclusions. There is inherent uncertainty in interpreting sentiments
due to language nuances, sarcasm, and varying expressions.
Approach:
Natural Language Processing (NLP): Sentiment analysis models, including recurrent neural
networks (RNNs) and transformer-based architectures (e.g., BERT), were trained on large
corpora of labeled data to classify sentiment as positive, negative, or neutral.
Fuzzy Sentiment Analysis: Fuzzy logic was used to handle uncertain and ambiguous
expressions, such as "somewhat satisfied" or "very disappointed," assigning degrees of
sentiment rather than binary classifications.
Uncertainty Estimation: The models were enhanced with techniques to quantify the
uncertainty of their predictions, providing confidence scores for each sentiment classification.
Outcome: The AI system achieved higher accuracy in sentiment classification and helped
businesses gain deeper insights into customer satisfaction. The addition of confidence scores
enabled businesses to identify feedback with high uncertainty, prompting further manual
review.
25
Authored By: Dr. Anup Girdhar