def finish(self):
		
		if self.v.size() == 0:
			self.pdf = OpdfGaussian(0.5, 0.05)
			return 
		try:
			self.pdf.fit(self.v)
			self.pdf.distribution.variance += 0.05
		except:
			self.pdf = OpdfGaussian(self.v.get(0).value, 0.05)
Beispiel #2
0
    def finish(self):

        if self.v.size() == 0:
            self.pdf = OpdfGaussian(0.5, 0.05)
            return
        try:
            self.pdf.fit(self.v)
            self.pdf.distribution.variance += 0.05
        except:
            self.pdf = OpdfGaussian(self.v.get(0).value, 0.05)
Beispiel #3
0
class ContDist(object):
    def __init__(self, varName):
        self.varName = varName
        self.v = Vector()
        self.pdf = OpdfGaussian()

    def addExample(self, d):
        value = d[self.varName]
        self.v.add(ObservationReal(value))

    def finish(self):

        if self.v.size() == 0:
            self.pdf = OpdfGaussian(0.5, 0.05)
            return
        try:
            self.pdf.fit(self.v)
            self.pdf.distribution.variance += 0.05
        except:
            self.pdf = OpdfGaussian(self.v.get(0).value, 0.05)

    def density(self, v):
        return self.pdf.probability(ObservationReal(v))
class ContDist(object):
	def __init__(self, varName):
		self.varName = varName
		self.v = Vector()
		self.pdf = OpdfGaussian()
	
	def addExample(self, d):
		value = d[self.varName]
		self.v.add(ObservationReal(value))
		
	def finish(self):
		
		if self.v.size() == 0:
			self.pdf = OpdfGaussian(0.5, 0.05)
			return 
		try:
			self.pdf.fit(self.v)
			self.pdf.distribution.variance += 0.05
		except:
			self.pdf = OpdfGaussian(self.v.get(0).value, 0.05)
			
	
	def density(self, v):
		return self.pdf.probability(ObservationReal(v))
	def __init__(self, varName):
		self.varName = varName
		self.v = Vector()
		self.pdf = OpdfGaussian()
Beispiel #6
0
 def __init__(self, varName):
     self.varName = varName
     self.v = Vector()
     self.pdf = OpdfGaussian()