SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Learning and Acting
with Bayes Nets
Chapter 20.
Page 2===
A Network and a Training Data
Page 3===
Learning Bayes Nets
 The problem of learning a Bayes network is to find a
network that best matches a training set of data,
.
–finding network:
• the structure of the DAG
• the conditional probability tables (CPTs) associated with each
node in the DAG.
 Known network structure
–No missing data
–Missing data
 Learning network structure
–The scoring metric
–Searching network space
Page 4===
Known Network Structure
 If we knew the structure of the network, we have
only to find the CPTs.
 No missing data
–Easy
–Each member of the training set  has a value for every
variable represented in the network.
 Missing data
–More difficult
–The values of some of the variables are missing for some of
the training records.
Page 5===
No Missing Data
 Training samples  compute sample statistics for
each node and its parents.
 CPT for some node Vi given its parents P(Vi)
–There are as many tables for the node Vi as there are
different values for Vi (less one).
–In Boolean case, just one CPT for a Vi.
–If Vi have ki parent nodes, then there are 2ki entries (rows)
in the table.
–The sample statistics for vi and pi
• Given by the number of samples in  having Vi = vi and Pi = pi divided by the
number of samples having Pi = pi )|(
^
iiii vVp pP 
Page 6===
An Example for No Missing Data
03.0
30
1
),|(
68.0)(
94.0)(
^
^
^




FalseLTrueBTrueMp
TrueLp
TrueBp
Page 7===
Some Points
 Some of the sample statistics in this example are
based on very small samples.
–This can lead to possibly inaccurate estimates of the
corresponding underlying probabilities.
–In general, the exponentially large number of parameters of a
CPT may overwhelm the ability of the training set to produce
good estimates of these parameters.
–Mitigating this problem is the possibility that many of the
parameters will have the same (or close to the same) value.
 It is possible that before samples are observed, we
may have prior probabilities for the entries in the
CPTs.
–Bayesian updating of the CPTs, given a training set, gives
appropriate weight to the prior probabilities.
Page 8===
Missing Data
 In gathering training data to be used by a learning
process, it frequently happens that some data are
missing.
–Sometimes, data are inadvertently missing.
–Sometimes, the fact that data are missing is important in
itself.
 The latter case is more difficult to deal with than
the former.
–In this lecture, we only deal with the former case.
Page 9===
An Example of Missing Data
Page 10===
The Weighted Sample
 For the three cases (G, M, B, L) = (False, True, *,
True)
–p(B|-G,M,L) could be computed with the CPTs of the network.
(Of course, there are no CPTs yet.)
–Then, each of these three examples could be replaced by two
weighted samples.
• One in which B = True, weighted by p(B|-G,M,L)
• The other in which B = False, weighted by p(-B|-G,M,L) = 1 –
p(B|-G,M,L)
 Each of the seven cases (G, M, B, L) = (*, *, True,
True) could be replaced by for weighted samples.
 Now, the estimates of the CPTs could be computed
with the weighted samples and the rest of the
samples.
Page 11===
The Expectation-Maximization (EM) Al
 First, random values are selected for the
parameters in the CPTs for the entire network.
 Secondly, the needed weights are computed.
 Thirdly, these weights are in turn used to estimate
new CPTs.
 Then, the second step and the third step are
iterated until the CPTs converge.
Page 12===
Learning Network Structure
 If the network structure is not known, we must then
attempt to find that structure, as well as its
associated CPTs, that best fits the training data.
 The scoring metric
–To score candidate networks
 Searching among possible structures
Page 13===
The Scoring Metric
 Several measures can be used to score competing
networks.
–One is based on a description length.
 Efficient codes take advantage of the statistical
properties of the data to be sent, and it is these
statistical properties that we are attempting to
model in the Bayes network.
 The best encoding requires L(,B) bits
][log),(  pBL
Page 14===
Minimum Description Length
 Given some particular data, , we might to try to
find the network B0 that minimizes L(,B).
 log p[] ( consists of m samples v1, …, vm.)
–Given a network structure and a training set, the CPTs that
minimize L(,B) are just those that are obtained from the
sample statistics computed from .
 L(,B) alone favors large networks with many arcs.
–In order to transmit , we must also transmit a description
of B so that the receiver will be able to decode the message.
 

m
i i
m
i i pppp 11
)(log)(log,)()( vv
2
log||
)(log),(' 1
mB
pBL
m
i i  
v
Page 15===
An Example for the Network Score
26.22358.2668.196),('
58.26
2
100log8
2
100log||
68.196),(
...
569.0
)()(),|()|(
)(







BL
B
BL
LpBpLBMpBGp
firstentryp
Page 16===
Searching Network Space
 The set of all possible Bayes Nets is so large that
we could not even contemplate any kind of
exhaustive search.
 Hill-descending or greedy search
–We start with a given initial network, evaluate L’(,B), and
then make small changes to it to see if these changes
produce networks that decrease L’(,B).
 The computation of description length is
decomposable into the computations over each CPT in
the network.
Page 17===
An Example of Structural Learning (1/2
Target network generates
training data.
Page 18===
An Example of Structural Learning (2/2
Induced network
learned from
prior network
and training data
Page 19===
Hidden Nodes
 The description-length score of the network on the
right will be better if this one also does as well
or better at fitting the data.
 Hidden nodes can be added in the search process and
the values of the corresponding hidden variables are
missing, so the EM algorithm is used.
Page 20===
Probabilistic Inference and Action
 The general setting
–An agent that uses a sense/plan/act cycle
–A goal
• A schedule of rewards that are given in certain environmental
states.
• The rewards induce a value for each state in terms of the total
discounted future reward that would be realized by an agent that
acted so as to maximize its reward.
–Our new agent knows only the probabilities that it is in
various states.
–An action taken in a given state might lead to any one of a
set of new states-with a probability associated with each.
• Through planning and sensing, an agent selects the action that
maximizes its expected utility.
Page 21===
An Extended Example
–E: a state variable {-2, -1, 0, 1, 2}
–Each location has a utility U.
–E0 = 0
–Ai: the action at the i-th time step {L, R}
• A successful move 0.5; no effect 0.25; an opposite move 0.25
• Si: the sensory signal at the i-th time step
–The same value with Ei 0.9; Each of the other values 0.025
Page 22===
Dynamic Decision Networks (1/2)
Page 23===
Dynamic Decision Networks (2/2)
 A special type of belief network
 After given the values E0 = 0, A0 = R, and S1 = 1,
we can use ordinary probabilistic inference to
calculate the expected utility value, U2, that would
result first from A1 = R, and then from A1 = L.
 Box-shaped nodes (): decision nodes
 Diamond-shaped nodes (): utility variables
Page 24===
Computation of Ex[U2] (1/2)
 The environment is Markovian by this network
structure.
 Ex[U2|E0 = 0, A0 = R, S1 = 1, A1 = R]
 Ex[U2|E0 = 0, A0 = R, S1 = 1, A1 = L]
 Using the polytree algorithm





1
1
)1,,0|(),|(
),1,,0|(),,1,,0|(
),1,,0|(
1001112
11001111002
11002
E
E
SRAEEpERAEp
RASRAEEpERASRAEEp
RASRAEEp
Page 25===
Computation of Ex[U2] (2/2)
 



1
),0|()|1(),|(
),1,,0|(
),0|()|1(
),0|(),,0|1()1,,0|(
00111112
11002
00111
00110011001
E
RAEEpESpERAEpk
RASRAEEp
RAEEpESkp
RAEEpERAESkpSRAEEp
•With this probability, the Ex[U2] given A1=R can be calculated.
• Similarly, Ex[U2] given A1=L can be calculated.
•Then the action that yields the larger value is selected.
Page 26===
Generalizing the Example








iE
iiiiiii
iiii
E
itbeforevaluesEpEsSpEAEpk
AsSitbeforevaluesEp
tbeforevaluesEpESpEAEpk
AStbeforevaluesEp
)|()|(),|(
),,|(
)1|()|1(),|(
),1,1|(
1
1
111112
112
1
Page 27===
Making Decisions about Actions (1/2)
1. From the last time step, (i - 1) (and after sensing Si
– 1 = si - 1), we have already calculated p(Ei|<values
before t = i>) for all values of Ei.
2. At time t = i, we sense Si = si and use the sensor
model to calculate p(Si = si|Ei) for all values of Ei.
3. From the action model, we calculate p(Ei + 1|Ai, Ei) for
all values of Ei and Ai.
4. For each value of Ai, and for a particular value of Ei
+ 1, we sum the product p(Ei + 1|Ai, Ei)p(Si =
si|Ei)p(Ei|<values before t = i>) over all values Ei
and multiply by a constant, k, to yield values
proportional to p(Ei + 1|<values before t = i>, Si = si,
Ai).
Page 28===
Making Decisions about Actions (2/2)
5. We repeat the preceding step for all the other values
of Ei+1 and calculate the constant k to get the actual
values of p(Ei+1|<values before t = i>, Si = si, Ai) for
each value of Ei+1 and Ai.
6. Using these probability values, we calculate the
expected value of Ui+1 for each value of Ai, and select
that Ai that maximizes that expected value.
7. We take the action selected in the previous step,
advance i by 1, and iterate.

Contenu connexe

Tendances

JOURNAL PAPER
JOURNAL PAPERJOURNAL PAPER
JOURNAL PAPER
Raj kumar
 

Tendances (19)

Multiclass Recognition with Multiple Feature Trees
Multiclass Recognition with Multiple Feature TreesMulticlass Recognition with Multiple Feature Trees
Multiclass Recognition with Multiple Feature Trees
 
Siamese networks
Siamese networksSiamese networks
Siamese networks
 
Cerebellar Model Articulation Controller
Cerebellar Model Articulation ControllerCerebellar Model Articulation Controller
Cerebellar Model Articulation Controller
 
Machine learning Algorithms with a Sagemaker demo
Machine learning Algorithms with a Sagemaker demoMachine learning Algorithms with a Sagemaker demo
Machine learning Algorithms with a Sagemaker demo
 
Support Vector Machine and Implementation using Weka
Support Vector Machine and Implementation using WekaSupport Vector Machine and Implementation using Weka
Support Vector Machine and Implementation using Weka
 
CMAC Neural Networks
CMAC Neural NetworksCMAC Neural Networks
CMAC Neural Networks
 
K Nearest Neighbor Algorithm
K Nearest Neighbor AlgorithmK Nearest Neighbor Algorithm
K Nearest Neighbor Algorithm
 
Self-organizing map
Self-organizing mapSelf-organizing map
Self-organizing map
 
Data Science - Part IX - Support Vector Machine
Data Science - Part IX -  Support Vector MachineData Science - Part IX -  Support Vector Machine
Data Science - Part IX - Support Vector Machine
 
Graph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkXGraph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkX
 
Fpga implementation of high speed
Fpga implementation of high speedFpga implementation of high speed
Fpga implementation of high speed
 
FPGA IMPLEMENTATION OF HIGH SPEED BAUGH-WOOLEY MULTIPLIER USING DECOMPOSITION...
FPGA IMPLEMENTATION OF HIGH SPEED BAUGH-WOOLEY MULTIPLIER USING DECOMPOSITION...FPGA IMPLEMENTATION OF HIGH SPEED BAUGH-WOOLEY MULTIPLIER USING DECOMPOSITION...
FPGA IMPLEMENTATION OF HIGH SPEED BAUGH-WOOLEY MULTIPLIER USING DECOMPOSITION...
 
Neural network
Neural networkNeural network
Neural network
 
Unsupervised learning clustering
Unsupervised learning clusteringUnsupervised learning clustering
Unsupervised learning clustering
 
A Novel Low Complexity Histogram Algorithm for High Performance Image Process...
A Novel Low Complexity Histogram Algorithm for High Performance Image Process...A Novel Low Complexity Histogram Algorithm for High Performance Image Process...
A Novel Low Complexity Histogram Algorithm for High Performance Image Process...
 
Extended Fuzzy C-Means with Random Sampling Techniques for Clustering Large Data
Extended Fuzzy C-Means with Random Sampling Techniques for Clustering Large DataExtended Fuzzy C-Means with Random Sampling Techniques for Clustering Large Data
Extended Fuzzy C-Means with Random Sampling Techniques for Clustering Large Data
 
Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design Patterns
 
CUDA Accelerated Face Recognition
CUDA Accelerated Face RecognitionCUDA Accelerated Face Recognition
CUDA Accelerated Face Recognition
 
JOURNAL PAPER
JOURNAL PAPERJOURNAL PAPER
JOURNAL PAPER
 

En vedette (7)

Cpt Syllabus
Cpt SyllabusCpt Syllabus
Cpt Syllabus
 
Lecture 3 Probability Theory
Lecture 3 Probability TheoryLecture 3 Probability Theory
Lecture 3 Probability Theory
 
Probability ppt by Shivansh J.
Probability ppt by Shivansh J.Probability ppt by Shivansh J.
Probability ppt by Shivansh J.
 
Introduction to probability
Introduction to probabilityIntroduction to probability
Introduction to probability
 
PROBABILITY
PROBABILITYPROBABILITY
PROBABILITY
 
Probability distribution notes by Dr D K Madan and Dr Amit Manocha
Probability distribution notes by Dr D K Madan and Dr Amit ManochaProbability distribution notes by Dr D K Madan and Dr Amit Manocha
Probability distribution notes by Dr D K Madan and Dr Amit Manocha
 
Basic Concept Of Probability
Basic Concept Of ProbabilityBasic Concept Of Probability
Basic Concept Of Probability
 

Similaire à 20 bayes learning

Poster_Reseau_Neurones_Journees_2013
Poster_Reseau_Neurones_Journees_2013Poster_Reseau_Neurones_Journees_2013
Poster_Reseau_Neurones_Journees_2013
Pedro Lopes
 
House Price Estimation as a Function Fitting Problem with using ANN Approach
House Price Estimation as a Function Fitting Problem with using ANN ApproachHouse Price Estimation as a Function Fitting Problem with using ANN Approach
House Price Estimation as a Function Fitting Problem with using ANN Approach
Yusuf Uzun
 
Electricity Demand Forecasting Using ANN
Electricity Demand Forecasting Using ANNElectricity Demand Forecasting Using ANN
Electricity Demand Forecasting Using ANN
Naren Chandra Kattla
 

Similaire à 20 bayes learning (20)

Disease Classification using ECG Signal Based on PCA Feature along with GA & ...
Disease Classification using ECG Signal Based on PCA Feature along with GA & ...Disease Classification using ECG Signal Based on PCA Feature along with GA & ...
Disease Classification using ECG Signal Based on PCA Feature along with GA & ...
 
N ns 1
N ns 1N ns 1
N ns 1
 
Evaluation of a hybrid method for constructing multiple SVM kernels
Evaluation of a hybrid method for constructing multiple SVM kernelsEvaluation of a hybrid method for constructing multiple SVM kernels
Evaluation of a hybrid method for constructing multiple SVM kernels
 
20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf
 
Poster_Reseau_Neurones_Journees_2013
Poster_Reseau_Neurones_Journees_2013Poster_Reseau_Neurones_Journees_2013
Poster_Reseau_Neurones_Journees_2013
 
AMAZON STOCK PRICE PREDICTION BY USING SMLT
AMAZON STOCK PRICE PREDICTION BY USING SMLTAMAZON STOCK PRICE PREDICTION BY USING SMLT
AMAZON STOCK PRICE PREDICTION BY USING SMLT
 
Perceptron in ANN
Perceptron in ANNPerceptron in ANN
Perceptron in ANN
 
Black-box modeling of nonlinear system using evolutionary neural NARX model
Black-box modeling of nonlinear system using evolutionary neural NARX modelBlack-box modeling of nonlinear system using evolutionary neural NARX model
Black-box modeling of nonlinear system using evolutionary neural NARX model
 
Accelerated Bat Algorithm For Solving Integer Programming Problems
Accelerated Bat Algorithm For Solving Integer Programming ProblemsAccelerated Bat Algorithm For Solving Integer Programming Problems
Accelerated Bat Algorithm For Solving Integer Programming Problems
 
COMPARING THE CUCKOO ALGORITHM WITH OTHER ALGORITHMS FOR ESTIMATING TWO GLSD ...
COMPARING THE CUCKOO ALGORITHM WITH OTHER ALGORITHMS FOR ESTIMATING TWO GLSD ...COMPARING THE CUCKOO ALGORITHM WITH OTHER ALGORITHMS FOR ESTIMATING TWO GLSD ...
COMPARING THE CUCKOO ALGORITHM WITH OTHER ALGORITHMS FOR ESTIMATING TWO GLSD ...
 
House Price Estimation as a Function Fitting Problem with using ANN Approach
House Price Estimation as a Function Fitting Problem with using ANN ApproachHouse Price Estimation as a Function Fitting Problem with using ANN Approach
House Price Estimation as a Function Fitting Problem with using ANN Approach
 
Electricity Demand Forecasting Using ANN
Electricity Demand Forecasting Using ANNElectricity Demand Forecasting Using ANN
Electricity Demand Forecasting Using ANN
 
# Neural network toolbox
# Neural network toolbox # Neural network toolbox
# Neural network toolbox
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structure
 
Bca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structureBca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structure
 
IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...
IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...
IRJET- Expert Independent Bayesian Data Fusion and Decision Making Model for ...
 
Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)
 
machine learning for engineering students
machine learning for engineering studentsmachine learning for engineering students
machine learning for engineering students
 
F017533540
F017533540F017533540
F017533540
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
 

Plus de Tianlu Wang

Plus de Tianlu Wang (20)

L7 er2
L7 er2L7 er2
L7 er2
 
L8 design1
L8 design1L8 design1
L8 design1
 
L9 design2
L9 design2L9 design2
L9 design2
 
14 pro resolution
14 pro resolution14 pro resolution
14 pro resolution
 
13 propositional calculus
13 propositional calculus13 propositional calculus
13 propositional calculus
 
12 adversal search
12 adversal search12 adversal search
12 adversal search
 
11 alternative search
11 alternative search11 alternative search
11 alternative search
 
10 2 sum
10 2 sum10 2 sum
10 2 sum
 
22 planning
22 planning22 planning
22 planning
 
21 situation calculus
21 situation calculus21 situation calculus
21 situation calculus
 
19 uncertain evidence
19 uncertain evidence19 uncertain evidence
19 uncertain evidence
 
18 common knowledge
18 common knowledge18 common knowledge
18 common knowledge
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systems
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based system
 
16 2 predicate resolution
16 2 predicate resolution16 2 predicate resolution
16 2 predicate resolution
 
16 1 predicate resolution
16 1 predicate resolution16 1 predicate resolution
16 1 predicate resolution
 
15 predicate
15 predicate15 predicate
15 predicate
 
09 heuristic search
09 heuristic search09 heuristic search
09 heuristic search
 
08 uninformed search
08 uninformed search08 uninformed search
08 uninformed search
 
07 plan agent
07 plan agent07 plan agent
07 plan agent
 

Dernier

FULL NIGHT — 9999894380 Call Girls In Patel Nagar | Delhi
FULL NIGHT — 9999894380 Call Girls In Patel Nagar | DelhiFULL NIGHT — 9999894380 Call Girls In Patel Nagar | Delhi
FULL NIGHT — 9999894380 Call Girls In Patel Nagar | Delhi
SaketCallGirlsCallUs
 
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | DelhiFULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
SaketCallGirlsCallUs
 
FULL NIGHT — 9999894380 Call Girls In Saket | Delhi
FULL NIGHT — 9999894380 Call Girls In Saket | DelhiFULL NIGHT — 9999894380 Call Girls In Saket | Delhi
FULL NIGHT — 9999894380 Call Girls In Saket | Delhi
SaketCallGirlsCallUs
 
(9711106444 )🫦#Sexy Desi Call Girls Noida Sector 4 Escorts Service Delhi 🫶
(9711106444 )🫦#Sexy Desi Call Girls Noida Sector 4 Escorts Service Delhi 🫶(9711106444 )🫦#Sexy Desi Call Girls Noida Sector 4 Escorts Service Delhi 🫶
(9711106444 )🫦#Sexy Desi Call Girls Noida Sector 4 Escorts Service Delhi 🫶
delhimunirka444
 
Massage And Sex Call Girls In Chandigarh 9053900678 Chandigarh Call Girls
Massage And Sex Call Girls In Chandigarh 9053900678 Chandigarh Call GirlsMassage And Sex Call Girls In Chandigarh 9053900678 Chandigarh Call Girls
Massage And Sex Call Girls In Chandigarh 9053900678 Chandigarh Call Girls
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
FULL NIGHT — 9999894380 Call Girls In Wazirabad | Delhi
FULL NIGHT — 9999894380 Call Girls In Wazirabad | DelhiFULL NIGHT — 9999894380 Call Girls In Wazirabad | Delhi
FULL NIGHT — 9999894380 Call Girls In Wazirabad | Delhi
SaketCallGirlsCallUs
 
Call Girls in Sakinaka 9892124323, Vashi CAll Girls Call girls Services, Che...
Call Girls in Sakinaka  9892124323, Vashi CAll Girls Call girls Services, Che...Call Girls in Sakinaka  9892124323, Vashi CAll Girls Call girls Services, Che...
Call Girls in Sakinaka 9892124323, Vashi CAll Girls Call girls Services, Che...
Pooja Nehwal
 
Powerful Love Spells in New York City, NY (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in New York City, NY (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in New York City, NY (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in New York City, NY (310) 882-6330 Bring Back Lost Lover
PsychicRuben LoveSpells
 
FULL NIGHT — 9999894380 Call Girls In Indirapuram | Delhi
FULL NIGHT — 9999894380 Call Girls In Indirapuram | DelhiFULL NIGHT — 9999894380 Call Girls In Indirapuram | Delhi
FULL NIGHT — 9999894380 Call Girls In Indirapuram | Delhi
SaketCallGirlsCallUs
 
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | DelhiFULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
SaketCallGirlsCallUs
 
Call Girl In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandigar...
Call Girl In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandigar...Call Girl In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandigar...
Call Girl In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandigar...
Sheetaleventcompany
 
FULL NIGHT — 9999894380 Call Girls In Kishangarh | Delhi
FULL NIGHT — 9999894380 Call Girls In Kishangarh | DelhiFULL NIGHT — 9999894380 Call Girls In Kishangarh | Delhi
FULL NIGHT — 9999894380 Call Girls In Kishangarh | Delhi
SaketCallGirlsCallUs
 
FULL NIGHT — 9999894380 Call Girls In Ashok Vihar | Delhi
FULL NIGHT — 9999894380 Call Girls In Ashok Vihar | DelhiFULL NIGHT — 9999894380 Call Girls In Ashok Vihar | Delhi
FULL NIGHT — 9999894380 Call Girls In Ashok Vihar | Delhi
SaketCallGirlsCallUs
 
FULL NIGHT — 9999894380 Call Girls In Dwarka Mor | Delhi
FULL NIGHT — 9999894380 Call Girls In Dwarka Mor | DelhiFULL NIGHT — 9999894380 Call Girls In Dwarka Mor | Delhi
FULL NIGHT — 9999894380 Call Girls In Dwarka Mor | Delhi
SaketCallGirlsCallUs
 

Dernier (20)

FULL NIGHT — 9999894380 Call Girls In Patel Nagar | Delhi
FULL NIGHT — 9999894380 Call Girls In Patel Nagar | DelhiFULL NIGHT — 9999894380 Call Girls In Patel Nagar | Delhi
FULL NIGHT — 9999894380 Call Girls In Patel Nagar | Delhi
 
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | DelhiFULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
FULL NIGHT — 9999894380 Call Girls In Delhi Cantt | Delhi
 
FULL NIGHT — 9999894380 Call Girls In Saket | Delhi
FULL NIGHT — 9999894380 Call Girls In Saket | DelhiFULL NIGHT — 9999894380 Call Girls In Saket | Delhi
FULL NIGHT — 9999894380 Call Girls In Saket | Delhi
 
(9711106444 )🫦#Sexy Desi Call Girls Noida Sector 4 Escorts Service Delhi 🫶
(9711106444 )🫦#Sexy Desi Call Girls Noida Sector 4 Escorts Service Delhi 🫶(9711106444 )🫦#Sexy Desi Call Girls Noida Sector 4 Escorts Service Delhi 🫶
(9711106444 )🫦#Sexy Desi Call Girls Noida Sector 4 Escorts Service Delhi 🫶
 
Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...
Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...
Sirmaur Call Girls Book Now 8617697112 Top Class Pondicherry Escort Service A...
 
THE ARTS OF THE PHILIPPINE BALLET PRESN
THE ARTS OF  THE PHILIPPINE BALLET PRESNTHE ARTS OF  THE PHILIPPINE BALLET PRESN
THE ARTS OF THE PHILIPPINE BALLET PRESN
 
Massage And Sex Call Girls In Chandigarh 9053900678 Chandigarh Call Girls
Massage And Sex Call Girls In Chandigarh 9053900678 Chandigarh Call GirlsMassage And Sex Call Girls In Chandigarh 9053900678 Chandigarh Call Girls
Massage And Sex Call Girls In Chandigarh 9053900678 Chandigarh Call Girls
 
FULL NIGHT — 9999894380 Call Girls In Wazirabad | Delhi
FULL NIGHT — 9999894380 Call Girls In Wazirabad | DelhiFULL NIGHT — 9999894380 Call Girls In Wazirabad | Delhi
FULL NIGHT — 9999894380 Call Girls In Wazirabad | Delhi
 
Call Girls in Sakinaka 9892124323, Vashi CAll Girls Call girls Services, Che...
Call Girls in Sakinaka  9892124323, Vashi CAll Girls Call girls Services, Che...Call Girls in Sakinaka  9892124323, Vashi CAll Girls Call girls Services, Che...
Call Girls in Sakinaka 9892124323, Vashi CAll Girls Call girls Services, Che...
 
(INDIRA) Call Girl Dehradun Call Now 8617697112 Dehradun Escorts 24x7
(INDIRA) Call Girl Dehradun Call Now 8617697112 Dehradun Escorts 24x7(INDIRA) Call Girl Dehradun Call Now 8617697112 Dehradun Escorts 24x7
(INDIRA) Call Girl Dehradun Call Now 8617697112 Dehradun Escorts 24x7
 
Powerful Love Spells in New York City, NY (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in New York City, NY (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in New York City, NY (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in New York City, NY (310) 882-6330 Bring Back Lost Lover
 
FULL NIGHT — 9999894380 Call Girls In Indirapuram | Delhi
FULL NIGHT — 9999894380 Call Girls In Indirapuram | DelhiFULL NIGHT — 9999894380 Call Girls In Indirapuram | Delhi
FULL NIGHT — 9999894380 Call Girls In Indirapuram | Delhi
 
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | DelhiFULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
FULL NIGHT — 9999894380 Call Girls In Shivaji Enclave | Delhi
 
Call Girl In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandigar...
Call Girl In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandigar...Call Girl In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandigar...
Call Girl In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandigar...
 
sources of Hindu law kdaenflkjwwfererger
sources of Hindu law kdaenflkjwwferergersources of Hindu law kdaenflkjwwfererger
sources of Hindu law kdaenflkjwwfererger
 
FULL NIGHT — 9999894380 Call Girls In Kishangarh | Delhi
FULL NIGHT — 9999894380 Call Girls In Kishangarh | DelhiFULL NIGHT — 9999894380 Call Girls In Kishangarh | Delhi
FULL NIGHT — 9999894380 Call Girls In Kishangarh | Delhi
 
FULL NIGHT — 9999894380 Call Girls In Ashok Vihar | Delhi
FULL NIGHT — 9999894380 Call Girls In Ashok Vihar | DelhiFULL NIGHT — 9999894380 Call Girls In Ashok Vihar | Delhi
FULL NIGHT — 9999894380 Call Girls In Ashok Vihar | Delhi
 
Moradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service Available
Moradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service AvailableMoradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service Available
Moradabad Call Girls - 📞 8617697112 🔝 Top Class Call Girls Service Available
 
FULL NIGHT — 9999894380 Call Girls In Dwarka Mor | Delhi
FULL NIGHT — 9999894380 Call Girls In Dwarka Mor | DelhiFULL NIGHT — 9999894380 Call Girls In Dwarka Mor | Delhi
FULL NIGHT — 9999894380 Call Girls In Dwarka Mor | Delhi
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 

20 bayes learning

  • 1. Learning and Acting with Bayes Nets Chapter 20.
  • 2. Page 2=== A Network and a Training Data
  • 3. Page 3=== Learning Bayes Nets  The problem of learning a Bayes network is to find a network that best matches a training set of data, . –finding network: • the structure of the DAG • the conditional probability tables (CPTs) associated with each node in the DAG.  Known network structure –No missing data –Missing data  Learning network structure –The scoring metric –Searching network space
  • 4. Page 4=== Known Network Structure  If we knew the structure of the network, we have only to find the CPTs.  No missing data –Easy –Each member of the training set  has a value for every variable represented in the network.  Missing data –More difficult –The values of some of the variables are missing for some of the training records.
  • 5. Page 5=== No Missing Data  Training samples  compute sample statistics for each node and its parents.  CPT for some node Vi given its parents P(Vi) –There are as many tables for the node Vi as there are different values for Vi (less one). –In Boolean case, just one CPT for a Vi. –If Vi have ki parent nodes, then there are 2ki entries (rows) in the table. –The sample statistics for vi and pi • Given by the number of samples in  having Vi = vi and Pi = pi divided by the number of samples having Pi = pi )|( ^ iiii vVp pP 
  • 6. Page 6=== An Example for No Missing Data 03.0 30 1 ),|( 68.0)( 94.0)( ^ ^ ^     FalseLTrueBTrueMp TrueLp TrueBp
  • 7. Page 7=== Some Points  Some of the sample statistics in this example are based on very small samples. –This can lead to possibly inaccurate estimates of the corresponding underlying probabilities. –In general, the exponentially large number of parameters of a CPT may overwhelm the ability of the training set to produce good estimates of these parameters. –Mitigating this problem is the possibility that many of the parameters will have the same (or close to the same) value.  It is possible that before samples are observed, we may have prior probabilities for the entries in the CPTs. –Bayesian updating of the CPTs, given a training set, gives appropriate weight to the prior probabilities.
  • 8. Page 8=== Missing Data  In gathering training data to be used by a learning process, it frequently happens that some data are missing. –Sometimes, data are inadvertently missing. –Sometimes, the fact that data are missing is important in itself.  The latter case is more difficult to deal with than the former. –In this lecture, we only deal with the former case.
  • 9. Page 9=== An Example of Missing Data
  • 10. Page 10=== The Weighted Sample  For the three cases (G, M, B, L) = (False, True, *, True) –p(B|-G,M,L) could be computed with the CPTs of the network. (Of course, there are no CPTs yet.) –Then, each of these three examples could be replaced by two weighted samples. • One in which B = True, weighted by p(B|-G,M,L) • The other in which B = False, weighted by p(-B|-G,M,L) = 1 – p(B|-G,M,L)  Each of the seven cases (G, M, B, L) = (*, *, True, True) could be replaced by for weighted samples.  Now, the estimates of the CPTs could be computed with the weighted samples and the rest of the samples.
  • 11. Page 11=== The Expectation-Maximization (EM) Al  First, random values are selected for the parameters in the CPTs for the entire network.  Secondly, the needed weights are computed.  Thirdly, these weights are in turn used to estimate new CPTs.  Then, the second step and the third step are iterated until the CPTs converge.
  • 12. Page 12=== Learning Network Structure  If the network structure is not known, we must then attempt to find that structure, as well as its associated CPTs, that best fits the training data.  The scoring metric –To score candidate networks  Searching among possible structures
  • 13. Page 13=== The Scoring Metric  Several measures can be used to score competing networks. –One is based on a description length.  Efficient codes take advantage of the statistical properties of the data to be sent, and it is these statistical properties that we are attempting to model in the Bayes network.  The best encoding requires L(,B) bits ][log),(  pBL
  • 14. Page 14=== Minimum Description Length  Given some particular data, , we might to try to find the network B0 that minimizes L(,B).  log p[] ( consists of m samples v1, …, vm.) –Given a network structure and a training set, the CPTs that minimize L(,B) are just those that are obtained from the sample statistics computed from .  L(,B) alone favors large networks with many arcs. –In order to transmit , we must also transmit a description of B so that the receiver will be able to decode the message.    m i i m i i pppp 11 )(log)(log,)()( vv 2 log|| )(log),(' 1 mB pBL m i i   v
  • 15. Page 15=== An Example for the Network Score 26.22358.2668.196),(' 58.26 2 100log8 2 100log|| 68.196),( ... 569.0 )()(),|()|( )(        BL B BL LpBpLBMpBGp firstentryp
  • 16. Page 16=== Searching Network Space  The set of all possible Bayes Nets is so large that we could not even contemplate any kind of exhaustive search.  Hill-descending or greedy search –We start with a given initial network, evaluate L’(,B), and then make small changes to it to see if these changes produce networks that decrease L’(,B).  The computation of description length is decomposable into the computations over each CPT in the network.
  • 17. Page 17=== An Example of Structural Learning (1/2 Target network generates training data.
  • 18. Page 18=== An Example of Structural Learning (2/2 Induced network learned from prior network and training data
  • 19. Page 19=== Hidden Nodes  The description-length score of the network on the right will be better if this one also does as well or better at fitting the data.  Hidden nodes can be added in the search process and the values of the corresponding hidden variables are missing, so the EM algorithm is used.
  • 20. Page 20=== Probabilistic Inference and Action  The general setting –An agent that uses a sense/plan/act cycle –A goal • A schedule of rewards that are given in certain environmental states. • The rewards induce a value for each state in terms of the total discounted future reward that would be realized by an agent that acted so as to maximize its reward. –Our new agent knows only the probabilities that it is in various states. –An action taken in a given state might lead to any one of a set of new states-with a probability associated with each. • Through planning and sensing, an agent selects the action that maximizes its expected utility.
  • 21. Page 21=== An Extended Example –E: a state variable {-2, -1, 0, 1, 2} –Each location has a utility U. –E0 = 0 –Ai: the action at the i-th time step {L, R} • A successful move 0.5; no effect 0.25; an opposite move 0.25 • Si: the sensory signal at the i-th time step –The same value with Ei 0.9; Each of the other values 0.025
  • 22. Page 22=== Dynamic Decision Networks (1/2)
  • 23. Page 23=== Dynamic Decision Networks (2/2)  A special type of belief network  After given the values E0 = 0, A0 = R, and S1 = 1, we can use ordinary probabilistic inference to calculate the expected utility value, U2, that would result first from A1 = R, and then from A1 = L.  Box-shaped nodes (): decision nodes  Diamond-shaped nodes (): utility variables
  • 24. Page 24=== Computation of Ex[U2] (1/2)  The environment is Markovian by this network structure.  Ex[U2|E0 = 0, A0 = R, S1 = 1, A1 = R]  Ex[U2|E0 = 0, A0 = R, S1 = 1, A1 = L]  Using the polytree algorithm      1 1 )1,,0|(),|( ),1,,0|(),,1,,0|( ),1,,0|( 1001112 11001111002 11002 E E SRAEEpERAEp RASRAEEpERASRAEEp RASRAEEp
  • 25. Page 25=== Computation of Ex[U2] (2/2)      1 ),0|()|1(),|( ),1,,0|( ),0|()|1( ),0|(),,0|1()1,,0|( 00111112 11002 00111 00110011001 E RAEEpESpERAEpk RASRAEEp RAEEpESkp RAEEpERAESkpSRAEEp •With this probability, the Ex[U2] given A1=R can be calculated. • Similarly, Ex[U2] given A1=L can be calculated. •Then the action that yields the larger value is selected.
  • 26. Page 26=== Generalizing the Example         iE iiiiiii iiii E itbeforevaluesEpEsSpEAEpk AsSitbeforevaluesEp tbeforevaluesEpESpEAEpk AStbeforevaluesEp )|()|(),|( ),,|( )1|()|1(),|( ),1,1|( 1 1 111112 112 1
  • 27. Page 27=== Making Decisions about Actions (1/2) 1. From the last time step, (i - 1) (and after sensing Si – 1 = si - 1), we have already calculated p(Ei|<values before t = i>) for all values of Ei. 2. At time t = i, we sense Si = si and use the sensor model to calculate p(Si = si|Ei) for all values of Ei. 3. From the action model, we calculate p(Ei + 1|Ai, Ei) for all values of Ei and Ai. 4. For each value of Ai, and for a particular value of Ei + 1, we sum the product p(Ei + 1|Ai, Ei)p(Si = si|Ei)p(Ei|<values before t = i>) over all values Ei and multiply by a constant, k, to yield values proportional to p(Ei + 1|<values before t = i>, Si = si, Ai).
  • 28. Page 28=== Making Decisions about Actions (2/2) 5. We repeat the preceding step for all the other values of Ei+1 and calculate the constant k to get the actual values of p(Ei+1|<values before t = i>, Si = si, Ai) for each value of Ei+1 and Ai. 6. Using these probability values, we calculate the expected value of Ui+1 for each value of Ai, and select that Ai that maximizes that expected value. 7. We take the action selected in the previous step, advance i by 1, and iterate.