### Changed behaviour of ProbabilityTable.to_jpt_by_states back to origninal...

`Changed behaviour of ProbabilityTable.to_jpt_by_states back to origninal behaviour, as is documented... I dont know who changed it`
parent aafe2df0
 ... ... @@ -44,7 +44,7 @@ print pt print "----burglary----" print pt.marginalization(alarm) print "----alarm----" print pt.division(burglary.get_cpd()) #print pt.division(burglary.get_cpd()) bn.draw()
 from primo.core import BayesNet from primo.reasoning import GaussNode from primo.reasoning import MarkovChainSampler from primo.reasoning import GibbsTransitionModel #Construct some simple BayesianNetwork. In this example it models #the linear relationship between the age of a plant and the height that #it has grown up to (+noise) #topology bn = BayesNet() age = GaussNode("Plant_age") height = GaussNode("Plant_height") bn.add_node(age) bn.add_node(height) bn.add_edge(age,height) #parameterization age_b0=numpy.array() age_variance=numpy.array() age_b=numpy.array() age.set_density_parameters(age_b0,age_b,age_variance) height_b0=numpy.array() height_variance=numpy.array([1.5]) height_b=numpy.array() height.set_densitiy_parameters(height_b0, height_b, height_variance)
 # -*- coding: utf-8 -*- from primo.reasoning.density import Density class CanonicalForm(Density): '''TODO: write doc''' def __init__(self): super(CanonicalForm, self).__init__() self.K=0 self.h=0 self.g=0
 ... ... @@ -87,7 +87,7 @@ class ProbabilityTable(Density): def normalize_as_jpt(self): '''This method normalizes this ProbabilityTable so it represents a valid joint probability table''' return self.table * 1.0 / numpy.sum(self.table) self.table = self.table * 1.0 / numpy.sum(self.table) def multiplication(self, inputFactor): '''This method returns a unified ProbabilityTable which contains the variables of both; the inputFactor ... ...
test_out.xmlbif 0 → 100644
 Test Net Weather Sun Rain position = (150, 200) Weather0 Sun Rain position = (150, 100) Ice_Cream_Eaten True False position = (150, 300) Weather Weather Weather0 0.7 0.3 0.5 0.5 Weather0 Weather0 0.6 0.4 Ice_Cream_Eaten Weather Ice_Cream_Eaten 0.9 0.1 0.2 0.8
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment