예제 #1
0
파일: monty.py 프로젝트: thenew01/py_test
 def __init__(self, hypos):
     """Initialize the distribution.
     hypos: sequence of hypotheses
     """
     Pmf.__init__(self)
     for hypo in hypos:
         self.Set(hypo, 1)
     self.Normalize()
예제 #2
0
 def __init__(self, hypos):
     """Initialize self.
     hypos: sequence of string bowl IDs
     """
     Pmf.__init__(self)
     for hypo in hypos:
         self.Set(hypo, 1)
     self.Normalize()
예제 #3
0
 def __init__(self, hypos):
     """Initialize the distribution.
     hypos: sequence of hypotheses
     """
     Pmf.__init__(self)
     for hypo in hypos:
         self.Set(hypo, 1)
     self.Normalize()
예제 #4
0
파일: train3.py 프로젝트: nlintz/CompBayes
    def __init__(self, hypos, alpha=1.0):
        """Initializes the hypotheses with a power law distribution.

        hypos: sequence of hypotheses
        """
        Pmf.__init__(self)
        for hypo in hypos:
            self.Set(hypo, hypo**(-alpha))
        self.Normalize()
예제 #5
0
    def __init__(self, hypos):
        """Initialize self.

        hypos: whether you play tennis or not 
        """
        Pmf.__init__(self)
        for hypo in hypos:
            self.Set(hypo, countdict[hypo])
        self.Normalize()
예제 #6
0
    def __init__(self, hypos):
        """UPDATE THIS DOCSTRING

        hypos: sequence of hypotheses representing possible company sizes
        """
        Pmf.__init__(self)
        for hypo in hypos:
            self.Set(hypo, int(max(hypos) / hypo) * hypo)
        self.Normalize()
예제 #7
0
파일: back.py 프로젝트: Boukos/cmu663
    def __init__(self, hypos):
        """Initialize self.

        hypos: whether you play tennis or not 
        """
        Pmf.__init__(self)
        for hypo in hypos:
            self.Set(hypo, countdict[hypo])
        self.Normalize()
예제 #8
0
    def __init__(self, hypos):
        """Initialize self.

        hypos: sequence of string bowl IDs
        """
        Pmf.__init__(self)
        for hypo in hypos:
            self.Set(hypo, 1)
        self.Normalize()
예제 #9
0
    def __init__(self, hypos, alpha=1.0):
        """Initializes hypotheses with a power law distribution.
			
			hypos: sequence of hypotheses
			alpha: parameter of the power law prior
			"""
        Pmf.__init__(self)
        for hypo in hypos:
            self.Set(hypo, hypo**(-alpha))
        self.Normalize()
 def __init__(self, sides):
     Pmf.__init__(self)
     for side in xrange(1, sides + 1):
         self.Set(side, 1)
     self.Normalize()
예제 #11
0
 def __init__(self, hypos):
     Pmf.__init__(self)
     for hypo_k, hypo_v in hypos.items():
         self.Set(hypo_k, 1)
     self.Normalize()
예제 #12
0
    def __init__(self,hypos):
        Pmf.__init__(self)

        for hypo in hypos:
            self.Set(hypo,1)
예제 #13
0
파일: mycookie2.py 프로젝트: aenfield/bayes
 def __init__(self, hypos):
     Pmf.__init__(self)
     for hypo in hypos:
         self.Set(hypo, 1)
     self.Normalize()
예제 #14
0
 def __init__(self, hypos):
     Pmf.__init__(self)
     for hypo in hypos:
         self.Set(hypo, 1)
     self.Normalize()
예제 #15
0
 def __init__(self, hypos, alpha = 1.0):
     Pmf.__init__(self)
     for hypo in hypos:
         self.Set(hypo, hypo**(-alpha))
     self.Normalize()
예제 #16
0
	def __init__(self, bowls):
		Pmf.__init__(self)
		self.bowls = bowls
		for hypo in bowls.keys():
			self.Set(hypo, 1)
		self.Normalize()
예제 #17
0
파일: mysinging.py 프로젝트: aenfield/bayes
 def __init__(self):
     Pmf.__init__(self)
     self.Set('goodsinger', 0.05)
     self.Set('badsinger', 0.95)
     self.Normalize()
예제 #18
0
 def __init__(self, sides):
     Pmf.__init__(self)
     for x in xrange(1, sides+1):
         self.Set(x, 1)
     self.Normalize()
예제 #19
0
    def __init__(self, hypos):
        Pmf.__init__(self)

        for who, prob in hypos.iteritems():
            self.Set(who, prob)
        self.Normalize()
예제 #20
0
 def __init__(self, hypo, alpha=1.0):
     Pmf.__init__(self)
     for hypo in hypos:
         self.Set(hypo, hypo**(-alpha))
     self.Normalize()